code: public static Matcher getWildcardMatcher(String str, String expr, boolean whole)
      {
          expr = expr.replaceAll("\\?",".?");
          expr = expr.replaceAll("\\*",".*?");
          if(whole)
              expr = "^"+expr+"$";
          Pattern pattern = Pattern.compile(expr/*, Pattern.DOTALL*/);
          return pattern.matcher(str);
      }
docs: Returns <CODE>true</CODE> if the given string matches the given regular expression.
  @param str The string against which the expression is to be matched
  @param expr The regular expression to match with the input string
  @param whole Indicates that a whole word match is required
  @return An object giving the results of the search (or null if no match found)