public static String formatAllowTypes(String allowTypes) {
        // emtpy or null
        if (LangUtils.isBlank(allowTypes)) {
            return allowTypes;
        }

        // not a correct regex pattern
        if (!allowTypes.startsWith("/")) {
            return allowTypes;
        }

        // pattern to format allowedTypes for FileUpload - formats like /.*\.(xls|xlsx|csv|txt)/
        Matcher matcher1 = ALLOW_TYPES_PATTERN.matcher(allowTypes);
        if (matcher1.find()) {
            return "." + matcher1.group(1).replace("|", ", .");
        }

        // pattern to format allowedTypes for FileUpload - formats like /(\.|\/)(gif|jpeg|jpg|png)$/
        Matcher matcher2 = ALLOW_TYPES_PATTERN_2.matcher(allowTypes);
        if (matcher2.find()) {
            return "." + matcher2.group(1).replace("|", ", .");
        }

        // rest return unchanged
        return allowTypes;
    }
Formats the allowTypes regex pattern in a more human-friendly format.
@param allowTypes The allowTypes regex pattern to format
@return The allowTypes formatted in a more human-friendly format.
primefaces/src/main/java/org/primefaces/util/FileUploadUtils.java