Regex Escape
Escape text for a literal regular expression or JavaScript constructor.
Escapes literal regex characters.
Your input is processed locally in this browser tab.
How to use Regex Escape
Paste or load literal text that contains regex metacharacters like ., *, +, ?, (), or [].
Choose Plain pattern to get an escaped string, or new RegExp(…) for a ready-to-paste JavaScript constructor.
Copy the escaped expression into your codebase or Regex Tester.
Frequently asked questions
Are slashes and brackets both escaped?
Yes. Special regex syntax tokens and forward slashes are escaped so they match literally in regex literals and constructors.
Is the input sent over the network?
No. Escaping runs completely on-device.