Does Java have a built-in way to escape arbitrary text so that it can be included in a regular expression? For example, if my users enter \"$5\", I\'d like to match that exa
I think what you're after is \Q$5\E. Also see Pattern.quote(s) introduced in Java5.
\Q$5\E
Pattern.quote(s)
See Pattern javadoc for details.