private static String wildcardToRegex(String pattern){
  return "^" + StringUtils.replaceEach(escapeRegexp(pattern),new String[]{"\\*","\\?"},new String[]{".*","."}) + "$";
}

private static String wildcardToRegex ( String pattern ) { return "^" + StringUtils . replaceEach ( escapeRegexp ( pattern ) , new String [ ] { "\\*" , "\\?" } , new String [ ] { ".*" , "." } ) + "$" ; }
converts wildcard to regular expression
