Regex Escape
Escape special regex characters for literal string matching.
Escape text so it can be used literally inside a regular expression. Characters with special meaning (. * + ? ^ $ { } ( ) | [ ] \ and, optionally, /) get a backslash in front, so "price (USD) $5.00" matches exactly that text instead of being read as a pattern. Paste a file name, a URL or any user input you want to match exactly.
Common use cases
- Search for a literal string that contains dots or brackets
- Build a pattern from user input safely
- Match a file name or URL exactly
How to use
- Paste the text.
- Leave Escape / ticked if you're writing a /pattern/ literal.
- Copy the escaped text into your regex.
FAQ
Why did my regex match too much?
Unescaped characters such as . match anything. example.com also matches exampleXcom unless the dot is escaped as \.
Where can I test the result?
Paste it into the regex tester.
Related tools
- Regex TesterTest and debug regular expressions with real-time match highlighting.
- Wildcard to RegexConvert wildcard patterns with * and ? to regular expressions.
- HTML EscapeConvert special HTML characters to their entity equivalents for safe display.
- Regex to WildcardConvert simple regular expressions back to wildcard patterns.
- CRC32 Hash GeneratorGenerate CRC32 checksums for quick data integrity checks.
- Lorem Ipsum GeneratorGenerate placeholder Lorem Ipsum text for design and development.