onlinetools.dev

Regex Tester

Test regular expressions with live match highlighting and groups

Runs locally
loading…
About this tool

Write a pattern, paste sample text, and every match is highlighted as you type — with capture groups, named groups and match positions listed underneath. The tester uses the JavaScript RegExp engine, so behavior matches exactly what Node.js and browsers will do, including lookbehind, named groups and Unicode property escapes.

Flags are toggled per letter (g, i, m, s, u, y, d) and the pattern is compiled on every keystroke; syntax errors surface immediately with the engine's own message rather than after you hit a button. Empty-match patterns like a* are handled safely, and runaway inputs are capped at 10,000 matches so a stray .* cannot freeze the tab.

Regex dialects differ between engines — a pattern that works here may need adjustment for PCRE, RE2 or Python's re module, mostly around lookbehind support, possessive quantifiers and inline flags.

Frequently asked questions

Which regex flavor does this tester use?
ECMAScript (JavaScript), as implemented by your own browser. It supports lookahead, lookbehind, named capture groups, backreferences and Unicode property escapes like \p{Letter} (with the u flag). It does not support PCRE-only syntax such as possessive quantifiers or recursion.
Why does my pattern match everything / nothing?
The two classic causes: an unescaped metacharacter (. matches any character — escape it as \. for a literal dot), or a missing g flag mentally — this tester always finds all matches, but your code will only find the first unless g is set.
What are named capture groups?
Syntax (?<name>...) labels a group so you can read matches by name instead of position: match.groups.name in JavaScript. The groups panel below the matches shows both numbered and named captures for each match.
Can a regex from here run unchanged in Python or Go?
Often, but not always. Character classes, quantifiers and anchors are portable; lookbehind, named-group syntax (Python uses (?P<name>...)) and inline flags differ. Go's RE2 engine additionally rejects backreferences and lookaround entirely.
Related tools