Regex Tester

Type a pattern and test string to see matches highlighted live, with every capture group and index.

/ /

Matches

# Match Index Groups

How to test a regular expression

1Type or paste your regular expression in the pattern field.
2Add your test string in the box below.
3See matches highlighted instantly, with groups and positions.
Why do I need the global flag?

The global (g) flag finds every match instead of just the first one. RegexLab enables it automatically when listing all matches.

What do the colors mean?

Each highlighted span is a separate match. Alternating colors make it easy to see where one match ends and the next begins.