Home Tools About

Regex Tester

Watch matches highlight live as you type a pattern — with capture groups, flags, and honest error messages when a pattern doesn't compile.

Ad space

Test a regular expression

g = all matches · i = case-insensitive · m = multiline anchors.

Matches

Waiting for a pattern…

Match details

#IndexFull matchGroups

How the regex tester works

Real JavaScript

Patterns are compiled with the platform's own RegExp engine, so a valid pattern here runs identically in your code. Invalid patterns produce the same errors you would see in the console.

Highlighted context

The sample text is redrawn with each match marked in place — the first in purple and the rest in green — so you can see exactly what the pattern covers and what it leaves alone.

Groups made visible

Capturing groups appear in the details table, position by position. Great for debugging template substitutions like $1/replace logic.

Regex tester FAQ

Which regex flavor does this use?

JavaScript/ECMAScript — the same engine browsers and Node use, so a pattern validated here behaves identically in your code.

Why is my pattern matching nothing?

Check flags first: without g only the first match is reported. Then check specials — . [ ] ( ) * + ? { } | \\ are all meaningful, so escape any literal one with a backslash.

What do the highlight colors mean?

Purple marks the very first match of the run; green marks every subsequent one. The rest of the text did not match.