Regex Escape Unescape
Escape plain text into a literal regex pattern or unescape an escaped pattern back to readable text in your browser.
Escape plain text for safe use inside a regular expression
When you search for a literal string with RegExp or regex-based replace tools, characters such as
., *, ?, and parentheses are treated as operators unless you escape them.
This tool inserts backslashes before regex metacharacters so the pattern matches the text exactly as typed.
Unescape mode reverses that transformation for patterns you copied from code generators.
How to use this tool
- Choose Escape for regex literal or Unescape pattern.
- Paste the string you want to transform.
- Copy the output into your JavaScript, Python, or editor regex field.
Pair this with the Regex Tester when you need to validate the final pattern against sample text.
Frequently Asked Questions
Does escape mode change letters and digits?
No. Only regex metacharacters receive a leading backslash. Letters, numbers, and spaces stay unchanged.
Will unescape turn \d into d?
No. Unescape only removes backslashes that guard metacharacters such as dots and parentheses. Shorthand classes like \d are left intact.
Is my text uploaded?
Processing happens entirely in your browser. Nothing is sent to a server.