How to use
- Type a pattern without the surrounding slashes, e.g.
\d{3}-\d{4}. - Toggle flags:
gglobal,iignore case,mmultiline,sdotAll,uunicode. - Matches are highlighted in the test text, and each match’s index and capture groups are listed below.
- Fill in the replacement field to preview
String.replace()output; use$1or$<name>for groups.
FAQ
Which regex flavor is used?
Your browser’s JavaScript (ECMAScript) engine, so results match exactly what new RegExp() does in your code — including lookbehind and named groups.
Why does my pattern only find one match?
Without the g flag, JavaScript stops after the first match. Enable g to find all of them.