RGX

Regex Escape

Escape and unescape regex special chars

Regex & String
🔒 100% client-side — your data never leaves this page
Maintained by Evan•Updated: September 29, 2026
Options
Regex Escape Input

Choose escape or unescape and convert the text first; strict validation and extra options are available in Advanced mode.

Converted Output
Converted result will appear here
🔒 Processed locally in your browser
Page reading mode

The full guide also includes pitfalls, worked examples, snippets, FAQs, and related tools for checking results or troubleshooting.

About this tool

Backslash-escape common regex operators, optionally including slash, or undo that same set of escapes. It produces pattern text rather than a quoted JavaScript string or full RegExp.escape output. Strict unescape checks this tool’s supported escape pairs, not full regex syntax; input and options are stored as a local draft.

Production Snippets

Literal filename and supported inverse conversion

text

Escape: file.name+(2026).txt
Output: file\.name\+\(2026\)\.txt
Unescape that output: file.name+(2026).txt
Strict unescape of \d: unsupported; not a regex validity judgment

Frequently Asked Questions

When does basic escaping help?

Use it to treat characters such as . + ( ) [ ] and backslash literally in a standalone pattern. For arbitrary dynamic fragments, character classes or concatenation after other escapes, use the target language’s full literal-escaping API and test the final pattern.

Should I enable escape slash?

Enable it when pasting a pattern into a JavaScript /.../ literal, where slash is a delimiter. A RegExp constructor does not use slash delimiters; JavaScript string quotes and backslashes still need their own source-code escaping.

What does strict unescape reject?

It accepts backslash pairs only for the operators this tool escapes, plus slash. It rejects other sequences such as \d, \n and a trailing backslash. Some rejected sequences are valid regex syntax; they are simply outside this conversion’s scope.

Can it recover arbitrary regexes as plain text?

No. It removes only supported literal escapes. Quantifiers, groups, character classes and semantic escapes are not evaluated or decoded, so it is not a general inverse of regex compilation.

Is the input saved?

Conversion is local and the page retains text and options in a browser draft. Clear removes the saved input. Avoid leaving sensitive literal search strings in a shared browser profile.

Keep browsing