DataToolsLab
Regex & Pattern Tools

Regex Escape / Unescape

Escape special regex characters for literal matching, or unescape an escaped regex.

Loading tool…

What is Regex Escape?

When searching for text that contains regex special characters (., *, +, ?, [, (, {, ^, $, |, \) literally, you need to escape them. This tool does it instantly, and can reverse the process too.

How it works

In escape mode, we prefix each special character with a backslash. In unescape mode, we strip those escaping backslashes.

  1. Enter your input. Type or paste your input into the field above — the tool responds instantly.
  2. Review the result. Output updates live as you type. Everything runs entirely in your browser.
  3. Copy or download. Use the Copy button to grab the result, or Download to save it as a file.

Examples

Literal user input

Escape metacharacters in a string so it matches literally — no more surprises when users type ( . * + ? into a search.

Common mistakes

Context matters

Escaping differs inside character classes — the tool handles both contexts correctly.

Frequently asked questions

When do I need to escape regex characters?

Any time you want to match a literal character that has special regex meaning — searching for aURL, a dollar amount, or file paths with dots.

Online