Test regular expressions online with live match highlighting, capture groups and replace preview. Uses JavaScript regex with all flags.
Frequently asked questions
Which regex flavor does this use?
JavaScript (ECMAScript) regular expressions, exactly as your browser runs them. That's the same syntax used in Node.js, TypeScript and most web tools, and it's very close to PCRE, Python and Java for everyday patterns.
What do the flags do?
g finds all matches instead of just the first. i ignores case. m makes ^ and $ match at line breaks. s lets . match line breaks too. u turns on full Unicode support, and y (sticky) only matches at the exact current position.
How do I use capture groups in the replacement?
Write $1, $2 and so on for numbered groups, $<name> for named groups like (?<name>…), and $& for the whole match. For example, swapping "Doe, Jane" to "Jane Doe" uses the pattern (\w+), (\w+) and the replacement $2 $1.
Is my text sent anywhere?
No. Matching happens in your browser as you type.