regex - How to escape text for regular expression in Java -
does java have built-in way escape arbitrary text can included in regular expression? example, if users enter "$5", i'd match rather "5" after end of input.
since java 1.5, yes:
pattern.quote("$5");
Comments
Post a Comment