Regular Expression Tester
Type a pattern, pick your flags, and watch matches light up live — with capture groups spelled out. Debug regex without the guesswork.
Matches
Capture groups (first 5 matches)
How to use the regex tester
- Type your regular expression in the pattern field — no slashes needed.
- Toggle the g, i, and m flags to change matching behavior.
- Paste your test string. Matches highlight instantly as you type.
- Expand the capture groups box to see exactly what each group caught.
Taming regular expressions
Regular expressions are a superpower with a terrible user interface: one misplaced parenthesis and a pattern silently matches the wrong thing — or nothing at all. The only sane way to write them is live, against real sample text, watching matches highlight as you type. That is what this tester is for. Start with the simplest pattern that could work, then grow it: literal text first, then character classes, then quantifiers, then groups. The global flag finds every match instead of stopping at the first; case-insensitive saves you from [a-zA-Z] clutter; multiline makes ^ and $ anchor to line starts and ends instead of the whole string. When a pattern misbehaves, bisect it — test each half separately until you find the offending piece. And remember the golden rule: now you have two problems is only funny because it is true. Validate emails and URLs with well-known patterns rather than inventing your own.
Frequently asked questions
Which regex flavor is this?
JavaScript — the same engine your browser uses. Patterns here behave identically in Node.js and in browser code.
Why isn't my pattern matching anything?
Check the flags first: without 'g' only the first match is found, and without 'i' matching is case-sensitive. Also watch for unescaped special characters like dots.
Does it support lookbehind?
It supports whatever your browser's JavaScript engine supports. Modern Chrome, Edge, Firefox, and Safari all handle lookbehind; very old browsers may not.
Is my pattern or test data saved anywhere?
No. Everything runs locally in your browser and nothing is stored or sent — safe for testing against production data samples.