Regex Tester
How to Test a Regular Expression
Testing a regular expression against real text is the fastest way to get it right. Enter a pattern and some sample text below to see matches highlighted live as you type.
Test your regex
//g
Contact us at hello@alldaytoolkit.com or support@example.org.
| # | Match | Index | Groups |
|---|---|---|---|
| 1 | hello@alldaytoolkit.com | 14 | — |
| 2 | support@example.org | 41 | — |
Steps to test a regex
- Type your pattern into the pattern field above.
- Add flags such as g (global) or i (case-insensitive) if you need them.
- Paste sample text underneath and watch the matches highlight live.
- Tweak the pattern until only the parts you want are matched.
A few handy patterns
| Goal | Pattern |
|---|---|
| Digits only | \d+ |
| A word | \w+ |
| Email-ish | [^@\s]+@[^@\s]+\.[^@\s]+ |
| Whitespace | \s+ |
Frequently asked questions
What do the g and i flags do?
g (global) finds all matches instead of stopping at the first; i (case-insensitive) ignores upper/lower case. You can combine them.
Does the tester send my text anywhere?
No. Matching runs in your browser as you type, so your pattern and sample text stay on your device.