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

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -