Regex Escape Tool
Escape special regex characters in a string so it can be used as a literal match in regular expressions.
How to Use Regex Escape Tool
The Regex Escape Tool is a free online utility that automatically escapes all special regular expression characters in your text so it can be used as a literal match pattern. Characters like . * + ? ^ $ { } ( ) | [ ] and backslash are prefixed with a backslash to prevent them from being interpreted as regex metacharacters. This is essential when building regex patterns from user input, searching for file paths or URLs that contain dots and slashes, matching dollar amounts or mathematical expressions, or any time you need to match text literally that contains regex-special characters. Results update in real-time as you type.
Step-by-Step Instructions
- Paste or type text containing special characters
- View the escaped result updating in real-time
- See which characters were escaped
- Copy the escaped string for use in your regex
Related Tools
JSON Formatter and Validator
Format, validate, and pretty-print JSON with syntax highlighting.
Base64 Encoder and Decoder
Encode text to Base64 or decode Base64 strings back to plain text.
URL Encoder and Decoder
Encode special characters for URLs or decode percent-encoded strings.
HTML Entity Encoder and Decoder
Encode special characters as HTML entities or decode them back.