Simple online tools for developers, networking, text and conversions.

Developer Tools

Regex Escape

Escape special characters for safe use inside regular expressions.

Tool

Use this regex escape tool to escape regex special characters such as dots, plus signs, parentheses, brackets, braces, and question marks so plain text can be used literally inside a regular expression. It is useful for search tools, validators, dynamic regex building, and exact text matching.

About this tool

Use this regex escape tool to escape regex special characters such as dots, plus signs, parentheses, brackets, braces, and question marks so plain text can be used literally inside a regular expression. It is useful for search tools, validators, dynamic regex building, and exact text matching.

Use regex escape when you need a fast browser-based result without extra setup. It works well for quick checks, one-off tasks, and routine formatting or calculation work.

Learn more

Why use this tool

How to use

  1. Paste the plain text into the input box.
  2. Run the tool to escape regex metacharacters.
  3. Review the escaped output.
  4. Copy the result into your regex pattern or code.

Examples

Example

Input

file(name).txt

Output

file\(name\)\.txt

Escapes special regex characters so the text can be matched literally.

Common errors

The user expects matching logic rather than literal escaping.

Fix: Use Regex Generator or Regex Tester if you need pattern logic, not escaped literal text.

Already escaped text is escaped again.

Fix: Check whether the input has already been processed before escaping it twice.

The escaped output is pasted into a context with different escaping rules.

Fix: Make sure the target language or regex engine uses the same escaping style.

FAQ

What does Regex Escape do?

It escapes regex metacharacters so your input text can be used as a literal string inside a regular expression.

When should I use it?

Use it when you need to match exact text that contains regex symbols like ., +, ?, (, ), [, or ].

What is this useful for?

It is useful when building regex dynamically from user input or pasted text.

Is this regex escape free to use?

Yes. It works online in the browser.

When should I use Regex Escape instead of Regex Generator?

Use Regex Escape when you already have literal text and want it matched exactly. Use Regex Generator when you want a pattern for a known format such as email or UUID.

Use cases

Related tools