question: public static String escapeRegex ( final String regex ) { Matcher match = REGEX_CHARS . matcher ( regex ) ; return match . replaceAll ( "\\\\$1" ) ; }
target:  This function will escape special characters within a string to ensure that the string will not be parsed as a regular expression. This is helpful with accepting using input that needs to be used in functions that take a regular expression as an argument (such as String.replaceAll(), or String.split()).