public boolean wildcardMatch(String text, String wildcard) {
        int idxText = 0;
        int idxWildcard = 0;
        int match = 0;
        int star = -1;
        int lenText = text.length();
        int wildcardLength = wildcard.length();
        while (idxText < lenText) {
            if ( idxWildcard < wildcardLength && 
                 (text.charAt(idxText) == wildcard.charAt(idxWildcard)
                  &&
                  wildcard.charAt(idxWildcard) != '*') 
                ) {
                idxText++;
                idxWildcard++;
            } else if (idxWildcard < wildcardLength && wildcard.charAt(idxWildcard) == '*') {
                match = idxText;
                star = idxWildcard;
                idxWildcard++;
            } else if (star != -1) {
                idxWildcard = star + 1;
                match++;
                idxText = match;
            } else {
                return false;
            }
        }
        while (idxWildcard < wildcardLength && wildcard.charAt(idxWildcard) == '*') {
            idxWildcard++;
        }
        if (idxWildcard == wildcardLength) {
            return true;
        } else {
            return false;
        }
    }
Tests a string against a list of wildcard patterns and return true if link matches any of the
patterns or if the provided list of patterns is empty. The only wildcard character supported is
the "*".
ache/src/main/java/achecrawler/util/WildcardMatcher.java