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.
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
Paste the text you want matched exactly
File names and prices often contain dots and plus signs.
- 2
Check a+b
The result is a\+b.
- 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?
How is a+b escaped?
Is a dot escaped?
Are letters escaped?
Does this run the pattern?
Keep going
Related tools
Last updated Report a problem or suggest a feature