Regex Escape Tool

Escape all regex metacharacters in your input instantly in your browser. Free online regex escape tool for building literal matches — no uploads.

Loading calculator…

Results

Escaped pattern
DetailValue
Special characters escaped

What is this calculator for?

Backslash-escape every regex metacharacter so your text is matched literally inside a regular expression.

How to Use This Calculator

Enter the values below, then press Calculate (or press Enter). The calculator updates your results instantly. Try different values to see how your inputs change the outcome.

  1. Text to escape — enter a value. A typical Text to escape would be e.g. file(1).txt [v2] 3.14$.
  2. Review your results — the key output is highlighted, with supporting figures below.

What You'll Need

Text to escape
a value · required

About This Calculator

Characters like . * + ? ( ) [ ] { } ^ $ | \ and - have special meaning in regular expressions.

This tool prefixes each with a backslash so they are treated as literal characters, which lets you match arbitrary text like version numbers or file paths exactly. Escaping runs instantly in your browser.

Worked Examples

Example

file\(1\)\.txt

Frequently Asked Questions

Why do I need to escape metacharacters?
Because unescaped metacharacters do not match literally: a dot matches any character and parentheses create groups. Escaping them makes the search text match exactly.
Does this work for all regex engines?
The escape set covers PCRE/JavaScript/Perl-style engines. Engines with the extended flag may treat whitespace differently, but this covers the common denominator.