Free Regex Tester & Debugger

Test a regular expression against your text with live match highlighting, capture groups, and a plain-English explanation.

//g
Test string
Matches0

No matches yet.

Replace (optional)
Explanation
(start of a capturing group
\d{4}any digit (0–9), exactly 4 times
)end of the group
-the character "-"
(start of a capturing group
\d{2}any digit (0–9), exactly 2 times
)end of the group
-the character "-"
(start of a capturing group
\d{2}any digit (0–9), exactly 2 times
)end of the group

How to use / FAQ

Enter a regular expression and some test text, and matches are highlighted live as you type. The panel below lists every match with its position and capture groups, an optional replace field previews substitutions, and the explanation section breaks your pattern down into plain English so you can see exactly what it does.

What regex flavor does this use?

It uses the JavaScript (ECMAScript) regular expression engine — the same one that runs in browsers and Node.js. Patterns behave exactly as they would in your JavaScript code, including flags like g, i, m, s, u, and y.

What do the flags mean?

g finds all matches instead of just the first, i ignores case, m makes ^ and $ match at line breaks, s lets the dot match newlines, u enables full Unicode handling, and y anchors matching to a sticky position. Toggle them with the buttons under the pattern.

How do capture groups and the replace preview work?

Parentheses create capture groups, shown beneath each match as $1, $2, and named groups. In the replace field you can reference them with $1, $2, or $<name> to rewrite matched text, and the result previews instantly.

Is my text sent anywhere?

No. The pattern runs against your text entirely in your browser — nothing is uploaded. Note that very complex patterns on large inputs can be slow, so input length and match count are capped to keep the page responsive.