100% client-side · nothing leaves your browser

Drop a regex
into any language

Paste a pattern once. Get it correctly escaped and wrapped in matching code for 8 languages — escaping rules for regex literals differ more than people expect.

pattern
output.js

  

Why this needs a converter at all

A regex pattern that works perfectly as a JavaScript literal can break silently when pasted into a Java string, because \d inside a Java string needs its backslash doubled to survive string-literal parsing before it ever reaches the regex engine. Python and Rust avoid this with raw strings; Go and Ruby have their own delimiter quirks. This tool applies the right escaping for each target automatically.

A flag naming gotcha

Ruby's m modifier means "dot matches newline" — in most other languages that's called s (dotall), and m means something else (multiline anchors, which Ruby's ^/$ do by default anyway). The generated Ruby snippet accounts for this automatically.