Online Regex Tester with Capture Groups

This regex tester runs your pattern with flags such as g, i and m against your own sample text and lists every match with its numbered groups and index. An invalid pattern produces the error message right away. Test an email, phone, postal-code or search pattern here before putting it in code; neither the pattern nor the text leaves your browser.

This tool runs entirely in your browser. No data is sent to any server.

How to use it

  1. 1

    Type the pattern in the first box and the flags (for example gi) in the second.

  2. 2

    Paste your sample text; matches are listed as you type.

  3. 3

    Check the groups and position of each match, then use the final pattern in your code.

Frequently asked questions

Which flags are supported?

The standard JavaScript flags: g for all matches, i for case-insensitive, m for multiline, plus s and u.

What are capture groups?

The parts of the pattern wrapped in parentheses; each value is listed separately in the groups column.

Can I replace text here?

This version shows matches and groups only. Use the code editor or your own code for replacement.