Regex tester
Write a regular expression to see every match and capture group in your text, and try a replacement.
How it works
The pattern is compiled with new RegExp(pattern, flags) in your browser and run with matchAll. Each match is highlighted and listed with its position and groups. To keep a slow pattern from freezing the page, at most 1,000 matches are listed.
Frequently asked questions
Which regex flavour is this?
JavaScript (ECMAScript), as in browsers and Node.js. Most syntax is shared with PCRE, Python and Java, but some features (possessive quantifiers, recursion) differ.
What do the flags mean?
g finds every match instead of the first, i ignores case, m makes ^ and $ match at each line, s lets . match line breaks, u enables full Unicode (needed for \p{L}), y matches only at the current position.
How do I use groups in the replacement?
Write $1, $2 for numbered groups, $<name> for named groups and $& for the whole match.