code: public boolean match(String s, String pattern) {
  
          preceededByMultipleChar = false;
          isEscaped = false;
          if (!caseSensitive) {
              pattern = pattern.toLowerCase();
              s = s.toLowerCase();
          }
          int
                  offset = 0;
  
          while (true) {
              String ps = getNextSubString(pattern);
              int len = ps.length();
              pattern = pattern.substring(len + escCnt);
  
              if (len > 0 && isWildcard(ps.charAt(0)) && escCnt == 0) {
                  offset = getWildcardOffset(ps.charAt(0));
                  if (isSingleWildcardChar(ps.charAt(0))) {
                      s = s.substring(1);
  // This is not yet enough: If a '*' precedes '?', 's' might be SHORTER
  // than seen here, for this we need preceededByMultipleChar variable...
                  }
                  if (pattern.length() == 0) {
                      return s.length() <= offset || preceededByMultipleChar;
                  }
              } else {
                  int idx = s.indexOf(ps);
                  if (idx < 0 || (idx > offset && !preceededByMultipleChar)) {
                      return false;
                  }
                  s = s.substring(idx + len);
                  preceededByMultipleChar = false;
              }
              if (pattern.length() == 0) {
                  return (s.length() == 0);
              }
          }
      }
docs: Matches a string against a pattern with wildcards. Two wildcard types
  are supported: single character match (defaults to '?') and ANY
  character match ('*'), matching any count of characters including 0.
  Wildcard characters may be escaped by an escape character, which
  defaults to '\'.
  
  @param s       The string, in which the search should be performed.
  @param pattern The search pattern string including wildcards.
  @return true, if string 's' matches 'pattern'.