That page doesn't exist. Search or drop a file below to find the tool you need.
What do you need to get done?
- Stays on this device
- No watermark
- Works offline
Drop a file here
or .
Open an app
Follow a recipe
Use one tool
Regex escape encode
Escape text for use in a regular expression. Every character that has a special meaning, such as . * + ? ( ) [ ] { } | ^ $ and the backslash, gets a backslash in front, so a regex matches your text literally. Runs in your browser, nothing is uploaded.
How to escape text for a regex
- 1Paste or type the text you want to match literally
- 2Read the escaped pattern in the result box
- 3Copy it into your regex, code or search field
- A pattern that matches your text exactly as typed.
What you get
- Literal match.The escaped text matches only itself, not a pattern.
- Nothing is uploaded.The text is escaped by your browser, on your own device.
- Updates as you type.Edit the input and the pattern follows.
What you can do
- Escape the 14 characters . * + ? ^ $ { } ( ) | [ ] and \ so a regex treats them as plain text.
- Look up a URL, a price, a file path or a sentence with punctuation in a pattern without surprises.
- Build a pattern from user input safely in code, by checking what the escaped form looks like.
- Copy the result with one click.
Good to know
- The hyphen and the forward slash are not escaped. Inside a character class a hyphen can still act as a range, and in a regex literal you need to escape / yourself.
- Letters and digits stay as they are, and so do spaces and line breaks.
- The escaping follows the JavaScript style. Other regex engines may treat a few characters differently.
- Test the result with the Regex tester before you rely on it.
Questions
How do I escape a string for a regex?
Paste the text into the input box. The result box shows it with a backslash in front of every special character.
Which characters are escaped?
The dot, asterisk, plus, question mark, caret, dollar sign, braces, parentheses, pipe, square brackets and the backslash.
Why escape at all?
Without it, a dot matches any character and a ( can break the pattern. Escaping makes the regex match your text exactly.
Is my text uploaded?
No. The conversion runs in your browser and nothing is sent.