private String globToRegex(String glob){
  if (glob.charAt(0) == '.' || glob.contains("/") || glob.contains("~")) {
    throw new IllegalArgumentException("Invalid character in file glob");
  }
  glob=glob.replace(".","\\.");
  glob=glob.replace("*",".+");
  glob=glob.replace("?",".{1}+");
  return glob;
}

private String globToRegex ( String glob ) { if ( glob . charAt ( 0 ) == '.' || glob . contains ( "/" ) || glob . contains ( "~" ) ) { throw new IllegalArgumentException ( "Invalid character in file glob" ) ; } glob = glob . replace ( "." , "\\." ) ; glob = glob . replace ( "*" , ".+" ) ; glob = glob . replace ( "?" , ".{1}+" ) ; return glob ; }
convert a limited file glob into a simple regex .
