SiteTidy
Home /Tools /Regex Escaper

Regex Escaper

Escape a literal string so it can be safely used in a regular expression without causing syntax errors.

Raw String

Escaped Regex Pattern

Why escape strings for Regex?

Regular expressions (regex) use certain characters to define rules, like . for "any character", * for "zero or more", or () for groups. If you want to search for these literal characters in a string (e.g., searching for a price like "$10.00"), you need to "escape" them by placing a backslash (\) before them, like this: \$10\.00.

This tool takes any literal string and automatically inserts backslashes before any regex control characters.

Characters Escaped

The following characters are considered special and are automatically escaped:
. * + ? ^ $ ( ) | [ ] \

Related Guides

Deepen your understanding with our expert articles.