0

Regex Escape Online — Escape Metacharacters

Escape or unescape strings for JSON, JavaScript/TypeScript, SQL and regex — live, entirely in your browser.

Need HTML entity or URL encoding instead? Use our HTML & URL Encoder / Decoder tool.

Processing... 0%

Result

This page opens the string escaper with regex mode preselected — paste literal text and every regex metacharacter is escaped so the result matches that exact text inside a new RegExp() pattern.

Regex escaping adds a backslash before each of the twelve special characters — . * + ? ^ $ { } ( ) | [ ] and the backslash itself — turning something like a.b*c into a\.b\*c, so it stops meaning "any character" or "zero or more" and instead matches those literal symbols.

This direction is one-way by design: there is no ambiguity to unescape, so decode mode is hidden for regex. The full tool also escapes JSON, JavaScript and SQL strings, entirely in your browser.