private String normalize ( String alias ) { // replace all the '.'s to '\.'s String regExp = alias . replaceAll ( "[\\.]" , "\\\\\\." ) ; // replace all the '*'s to '.*'s regExp = regExp . replaceAll ( "[*]" , "\\.\\*" ) ; // System.out.println("Normalized "+alias+" to "+regExp); return regExp ; }
This method normalizes the alias into a valid regular expression