CompleteToolkit

Regex Tester

Test regular expressions live — matches highlighted in your text, capture groups listed below.

//gi
Flags

2 matches

Contact us at hello@example.com or support@toolkit.dev for help.

About this tool

Regular expressions are famously write-only: easy to produce, hard to trust. The gap between "I think this pattern matches emails" and "it actually does, on my data" is exactly what a tester closes. Type a pattern, paste your real text, and every match lights up instantly — no guessing, no console.log loops, no deploying to find out.

Three things make this tester genuinely useful for debugging. Matches are highlighted inline in your test string, so you see not just that the pattern matched, but precisely which characters it consumed — the fastest way to spot a greedy quantifier eating more than intended. Capture groups are listed per match below, so extraction patterns can be verified before they reach your code. And invalid patterns show the JavaScript engine's own error message, which names the actual problem ("Unterminated group") instead of failing silently.

The three most-used flags are one click each: g (find all matches, not just the first), i (ignore case) and m (multiline, so ^ and $ match line boundaries). The tester uses your browser's native JavaScript regex engine — meaning what matches here matches identically in your Node.js or frontend code, with no dialect surprises. A sample email pattern is preloaded so you can see it working immediately.

How to use the Regex Tester

  1. 1Type your pattern between the slashes — a sample email matcher is preloaded.
  2. 2Toggle flags: g (all matches), i (ignore case), m (multiline).
  3. 3Paste your real test text — matches highlight instantly as you type either field.
  4. 4Check the capture groups list below to verify extractions.

Frequently asked questions

Which regex flavor does this tester use?

JavaScript's native engine — the same one in Node.js and every browser. Patterns validated here behave identically in JavaScript code. Most patterns also transfer to Python or Java, but a few advanced features differ between flavors.

What do the g, i and m flags do?

g (global) finds every match instead of stopping at the first. i (ignore case) makes 'Cat' match 'cat'. m (multiline) makes ^ and $ anchor at each line's start and end rather than only the whole string's.

What are capture groups?

Parts of a pattern wrapped in parentheses that extract sub-matches. In (\w+)@(\w+), group $1 captures the part before the @ and $2 the part after. The tester lists each match's groups so you can verify extractions before using them in code.

Why does my pattern match more than I expected?

Usually a greedy quantifier: .* grabs as much as possible. The inline highlighting shows exactly what was consumed — if a match sprawls too far, try the lazy version .*? or a more specific character class like [^,]* to stop at a delimiter.