private String toRegex ( String mappings ) { assert mappings != null ; // Get rid of spaces mappings = mappings . replaceAll ( "\\s" , "" ) ; // Escape '.' mappings = mappings . replaceAll ( "\\." , "\\\\." ) ; // Change '*' to '.*' to represent any match mappings = mappings . replaceAll ( "\\*" , ".*" ) ; // Split the mappings by changing ';' to '|' mappings = mappings . replaceAll ( ";" , "|" ) ; return mappings ; }
Convert the specified mapping string to an equivalent regular expression .