Skip to content
Toolspire

Developer Tools

Regex Escape

Regex Escape is part of Toolspire and is ready as soon as this page loads. The characters escaped are \ ^ $ . * + ? ( ) [ ] { } and |. Letters and digits are copied. This does not compile or test the pattern.

Runs in this tabFreeNo account

On this page

What you can do here

A literal, not a test

The regex tester runs a pattern. This page only quotes one.

The sample is the plus

a+b is the check that a quantifier became a character.

Empty input is refused

There is nothing to escape.

The sequence

How to use the Regex Escape

  1. 1

    Paste the text you want matched exactly

    File names and prices often contain dots and plus signs.

  2. 2

    Check a+b

    The result is a\+b.

  3. 3

    Take the escaped text to the regex tester

    This page does not run it.

Worth knowing

  • Regex Escape on Toolspire: a+b escapes to a\+b.
  • The plus would otherwise mean one or more a’s. The slash makes it a plus sign.
  • . * ? ( ) [ ] { } | ^ $ and \** are escaped too.
  • Letters and digits are not escaped. “cat” stays “cat”.

A plus sign is not a quantifier anymore

In a regular expression, a plus means one or more of the previous atom. A file named a+b should not be described by that pattern. Putting a backslash before the plus makes it an ordinary plus. The same escape is applied to the other metacharacters. Letters stay bare, so a long sentence does not become a forest of slashes. The page does not check whether the result finds a match. That is the regex tester.

FAQ

Questions about Regex Escape

Where does Regex Escape run?

Regex Escape runs in this tab on Toolspire. What you type or drop in is not sent to us and is not stored on a server.

How is a+b escaped?

a\+b.

Is a dot escaped?

Yes. A dot would otherwise match any character.

Are letters escaped?

No.

Does this run the pattern?

No. It only quotes the text.

Keep going

Open the full directory

Last updated Report a problem or suggest a feature