Type a pattern, toggle flags, paste test text — and watch highlighted matches, positions, and capture groups (named included) update live, with the engine’s real error message the moment a pattern goes wrong. JavaScript flavor: exactly what your code will do.
How to test a regex
- Enter the pattern (no surrounding slashes) and tick the flags —
gis on by default. - Paste the test string.
- Read the highlighted preview and the per-match list with indices and groups.
Built for the debugging loop
Regex development is guess-check-adjust, and the check step should be instant and honest. The
highlight view answers “what did it grab?” at a glance — including the classic
too-greedy .* swallowing half the line. The match list answers the follow-ups: exact offsets
(for slicing), and what each capture group extracted, which is where most “the regex matches
but my code gets undefined” bugs live. Invalid patterns surface the engine’s own message
(“Unmatched ‘(’”) rather than silently matching nothing, and zero-length matches are shown as
such instead of looping the page.
JavaScript flavor, stated up front
Testers that run PCRE while you write JavaScript produce patterns that pass the tester and fail
in production. This one runs your browser’s engine, so behavior — including u-flag Unicode
classes and multiline anchors — is precisely what new RegExp(pattern, flags) will do in your
code. Extracting structured text at scale? Pair with the
CSV ⇄ JSON converter for the tabular part, and the
JSON formatter to inspect results.
Private by design
Test text is usually real data — logs, exports, config. It stays in your browser: evaluation is local, nothing is transmitted or retained.