HomeRegex Escape

Regex Escape

Escape special characters in regular expressions to match them literally



Documentation

About Regex Escape

This tool converts plain text into regex-safe literals so special tokens like ., *, and ? are treated as normal characters.

Key Features

  • Regex Escape: Escapes regex metacharacters automatically.
  • Unescape: Restores escaped text for review or editing.
  • Swap Input/Output: Quickly switch directions.
  • Sample + Copy: Test quickly and copy results.

Common Metacharacters

Char Meaning Escaped
. any single char \\.
* zero or more \\*
+ one or more \\+
? zero or one \\?
[ ] char class \\[ \\]
( ) grouping \\( \\)

Steps

  1. Enter source text.
  2. Click escape to generate regex-literal-safe content.
  3. Click unescape when needed.
  4. Copy output into code or shell usage.

FAQ

When should I always escape first?

When text comes from users or external input and should be matched literally.

Does unescape remove all backslashes?

No. It only converts valid escaped regex tokens back to their literal form.