Regex Escape Tool

Escape special characters so any text can be used literally inside a regular expression.

About this tool

Escapes . * + ? ^ $ { } ( ) | [ ] \ / and - so user-supplied strings match literally in JavaScript, Python and most regex engines. Unescape reverses it.

Related: JSON Formatter & Validator · Base64 Encode & Decode · URL Encoder & Decoder · SHA-256 / SHA-1 Hash Generator · Unix Timestamp Converter