public void add(String pattern, boolean isJavaRegex, MimeType type) throws MimeTypeException {
        if (pattern == null || type == null) {
            throw new IllegalArgumentException("Pattern and/or mime type is missing");
        }

        if (isJavaRegex) {
            // in this case, we don't need to build a regex pattern
            // it's already there for us, so just add the pattern as is
            addGlob(pattern, type);
        } else {

            if (pattern.indexOf('*') == -1 && pattern.indexOf('?') == -1 &&
                    pattern.indexOf('[') == -1) {
                addName(pattern, type);
            } else if (pattern.startsWith("*") && pattern.indexOf('*', 1) == -1 &&
                    pattern.indexOf('?') == -1 && pattern.indexOf('[') == -1) {
                String extension = pattern.substring(1);
                addExtension(extension, type);
                type.addExtension(extension);
            } else {
                addGlob(compile(pattern), type);
            }
        }
    }
Index of generic glob patterns, sorted by length.
tika-core/src/main/java/org/apache/tika/mime/Patterns.java