Skip to content

Regex Playground

Build and test regular expressions with live matches, capture groups, and curated presets.

Pattern

Test string

0 chars · 0 lines0 matches

Matches
0

Nothing to match yet

Enter a pattern and some test text.

Replace

Regex Playground FAQ

Which regex flavor does the playground use?
Your browser's built-in JavaScript RegExp engine (ECMAScript), so patterns behave exactly as they will in JavaScript or TypeScript code. PCRE-only syntax such as possessive quantifiers or atomic groups is not supported.
Which flags can I toggle?
g (global), i (ignore case), m (multiline), s (dotall), u (unicode) and y (sticky). Without the g flag only the first match is reported.
How do I reference capture groups in a replacement?
Open the replace panel and use $1, $2 for numbered groups, $<name> for named groups and $& for the whole match. The result updates live and can be copied.
What happens if my pattern hangs?
Matching runs in a background Web Worker, so the page stays responsive. If a pattern takes longer than 1.5 seconds — typically catastrophic backtracking from nested quantifiers such as (a+)+ — the run is stopped and an error is shown instead of freezing the tab.
How do I share a pattern?
Click the share button next to the pattern to copy a link. The pattern, flags, test text and replacement are stored in the URL hash (after #), which browsers never send to a server; very long test text is left out of the link.
Is my test text sent anywhere?
No. Matching and replacing run entirely in your browser; neither the pattern nor the text leaves your device.