Which characters are escaped?
All regex metacharacters: . * + ? [ ] ( ) { } ^ $ | \ and sometimes # and whitespace in verbose mode patterns.
Regex Escape converts any text string into a safe regular expression literal by adding backslashes before all special regex characters. When you build regex patterns dynamically from user input, unescaped special characters like . * + ? ( ) [ ] { } ^ $ | change the meaning of the pattern and produce incorrect matches. This tool escapes all of them in one click.
The tool adds a backslash before every character that has special meaning in regex: . * + ? [ ] ( ) { } ^ $ | and \. After escaping, the pattern matches those characters literally instead of treating them as regex operators. This is equivalent to calling Python's re.escape() or JavaScript's equivalent escaping logic.
All regex metacharacters: . * + ? [ ] ( ) { } ^ $ | \ and sometimes # and whitespace in verbose mode patterns.
Yes. Python's re.escape() produces the same output for ASCII strings. This tool works for any language that uses standard regex syntax.
The escaped version is only for use inside a regex pattern. When the pattern matches, it will find the original unescaped literal text.
No. The tool runs entirely in your browser. Your data never leaves your device.
Yes, completely free. No account required.
Yes. All Unicode characters are supported. Only the standard ASCII regex metacharacters are escaped.
Tool workspace
Free online regex escape tool — instantly escape special regex characters in any string. Convert literal text to a safe regex pattern. No login, runs in browser.
Input
Output
Input
hello.world (test)
Output
hello\.world \(test\)