Regex Tester

Highlight matches in real time, show capture groups, with g/i/m toggles

How to use

  1. Enter a pattern in the "Regular expression" box, e.g. (\w+)@(\w+)\.(\w+).
  2. Toggle the g / i / m switches as needed.
  3. Fill the sample in "Test text" and click "Test".
  4. Tip: check g to highlight all matches; otherwise only the first is shown.

FAQ

Why is only one match highlighted sometimes?

Without g (global) checked, the regex matches only the first result. With g it highlights all matches.

What is shown for empty capture groups?

Groups that did not participate in the match show as "undefined", which is normal and usually happens when an optional group is unmatched.