Regex Tester
Enter a pattern and some text to test it. Matches are highlighted below, and each one is listed with its capture groups and position.
—
| # | Match | Index | Groups |
|---|
How it works
The pattern is compiled with your browser’s nativeRegExp engine. With the g flag, every match is found and highlighted; capture groups are shown for each match.
The i flag ignores case, m makes^ and $ match line boundaries, ands lets . match newlines.
Quick cheatsheet
| Goal | Pattern |
|---|---|
| Any character | . |
| Zero or more | * |
| One or more | + |
| Optional | ? |
| Word boundary | \b |
| Digit | \d |
| Word char | \w |
| Match a set | [a-z] |
| Group | (…) |
| Start / end | ^ … $ |
Frequently asked questions
Why aren’t all my matches showing?
Make sure the g (global) flag is on. Without it, only the first match is returned.
What are capture groups?
Parentheses (…) capture the part of the match inside them. They’re listed in the “Groups” column so you can see exactly what each part matched.

