Regex Tester

Test regular expressions live against your own text, with match highlighting, capture groups and a match count. Fast, private and entirely client-side.

Runs locally · nothing uploaded
Expression
/ /

Test string
Matches
Matches will be highlighted here.
Details
Matches

How it works

This tester compiles your pattern into a native JavaScript RegExp using the flags you provide, then runs it against the test string in your browser. As you edit the pattern, flags or text, everything recomputes instantly — there is no server round-trip and nothing you type ever leaves your device.

Matches are highlighted directly in your text. The HTML is escaped before rendering, so even markup-heavy input is displayed literally and safely. For each match, captured groups (both numbered and named) are listed alongside the total match count. If the pattern fails to compile, the status line surfaces the exact engine error, and if a global pattern would match an empty string, the tester advances safely so it never loops forever.

Because it uses the browser’s built-in ECMAScript engine, the syntax and results mirror exactly what you’ll get from new RegExp() in Node.js or front-end code — making it a reliable place to prototype patterns before shipping them.

Frequently asked questions

Is my pattern or test string sent to a server?
No. The tool builds a native JavaScript RegExp in your browser and runs it against your text locally. Nothing you type is uploaded, logged or stored.
Which regular expression flavor does this use?
It uses the browser’s built-in ECMAScript (JavaScript) regex engine — the same one you get from new RegExp(). Syntax and behavior match what you’ll ship in Node.js and front-end code.
What do the flags mean?
g matches globally (all occurrences), i ignores case, m makes ^/$ match line boundaries, s lets . match newlines, u enables full Unicode mode, and y anchors matching to lastIndex (sticky).
Why do I get "Invalid regular expression"?
The pattern couldn’t be compiled — usually an unbalanced bracket or parenthesis, a dangling \, or a quantifier with nothing to repeat. The status line shows the exact engine error so you can fix it.