πŸ” Regex Tester

Test and debug regular expressions with live match highlighting, capture group extraction, and find-and-replace preview. Uses the JavaScript regex engine.

Live Highlighting Capture Groups Replace Preview
/ /
Flags:
Match Preview
odd even matches
Find & Replace Preview

FAQ

What regex engine does this use?

This tool uses the built-in JavaScript RegExp engine, which is ECMAScript-compliant. It supports lookahead/lookbehind, named capture groups ((?<name>...)), Unicode mode (u flag), dotAll (s flag), and the d flag for match indices.

How do I use capture groups in the replacement string?

Reference numbered groups with $1, $2, etc. Named groups with $<name>. $& inserts the full match. $$ inserts a literal dollar sign.

What does the 'g' (global) flag do?

Without g, the regex finds only the first match. With g, it finds all non-overlapping matches. The g flag is required for replacement to replace all occurrences.

What does the 'm' (multiline) flag do?

With m, the ^ anchor matches the start of each line (not just the start of the string), and $ matches the end of each line. Without m, they only match the very start and end of the entire input.

Is my test text sent anywhere?

No. All regex matching is done using the browser's native RegExp API. Nothing is ever sent to a server.