Regex Tester

Test regular expressions against sample text with live matches.

Runs locally in your browser. Your input is not uploaded or stored. You can verify this in your browser’s network panel.

What does this tool solve?

Enter a JavaScript-flavored regular expression, pick flags, and see every match with its position and capture groups. Uses your browser's native RegExp engine — what you test is what JavaScript will do.

What examples should you start with?

Email-ish pattern

Input

\b[\w.]+@[\w.]+\.\w+\b with flag g

Output

matches like “user@example.com” with index positions

Capture groups

Input

(\d{4})-(\d{2})-(\d{2})

Output

each match lists groups: year, month, day

How does it work?

The pattern and flags are compiled with JavaScript's RegExp and executed against your sample text. Matches are collected with their start index and capture groups.

Zero-width matches advance automatically so patterns like a* cannot loop forever, and result lists are capped to keep the page responsive.

What are the edge cases and limits?

  • This is JavaScript regex syntax — lookbehind and named groups work, but PCRE-only features (\K, atomic groups in older engines) may not.
  • The g flag collects all matches; without it you get the first match only.
  • Catastrophic backtracking is possible with nested quantifiers like (a+)+$ — if a test seems stuck, simplify the pattern.
  • Result display is capped at 500 matches.

Technical reference

Related tools

Related guides