REGEX ESCAPE TOOL
Escape regex special characters so text matches literally, in your choice of flavor. Nothing leaves your browser.
|
Escaped pattern
How to escape text for a regex
- 1
Pick Escape or Unescape.
- 2
Choose the regex flavor you are targeting.
- 3
Paste or type your text.
- 4
Copy the result into your pattern.
Questions
- Which characters need escaping in a regex?
- Metacharacters such as . * + ? ^ $ { } ( ) | [ ] and the backslash itself must be escaped with a backslash to match literally.
- Why are there different flavors?
- Languages differ slightly: Python's re.escape also escapes characters like - & ~ # and whitespace, while POSIX tools only need the core metacharacters.
- Can I turn an escaped pattern back into plain text?
- Yes. Switch to Unescape to strip backslashes before punctuation and restore \n, \t and \r.
- Is my text uploaded?
- No. Escaping runs locally in your browser.
Related tools
- Regex ExplainerPaste a regular expression and get a plain-English breakdown of every token, group, and quantifier.
- Regex TesterTest a regex against a string with live match highlighting.
- Cron Expression GeneratorBuild cron schedules visually or from presets, copy the expression, and preview the next 5 run times in your local timezone.
- CSS Escape GeneratorEscape text for a safe CSS class/ID selector or string literal, using the browser's native CSS.escape().
- URL Encoder / DecoderPercent-encode or decode text and URLs, component or full-URL scope.
- Base64 EncoderEncode text to Base64 or decode it back, with correct UTF-8 handling.
- Hash GeneratorGenerate SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text.
- Hex ConverterConvert text to hexadecimal and back, both directions in one tool.