Regex Tester
The Regex Tester runs JavaScript regular expressions against your sample text in real time, highlighting every match and capture group. Toggle flags like global, ignore-case and multiline, and inspect group results. All evaluation happens locally in your browser.
| # | Match | Index | Groups |
|---|---|---|---|
| 1 | [email protected] | 14 | — |
| 2 | [email protected] | 41 | — |
Regular expressions are compact patterns for finding and extracting text, but they're notoriously easy to get subtly wrong. This tester runs your pattern against real sample text as you type, highlighting every match and capture group so you can refine it with immediate feedback.
How to use the Regex Tester
- Enter your regular expression and toggle flags like global, ignore-case or multiline.
- Paste the sample text you want to match against.
- Inspect the highlighted matches and numbered capture groups to confirm the pattern.
Common use cases
- Validate an email, phone number or postcode format before shipping it in code.
- Extract fields from a log line or CSV row using capture groups.
- Prototype a find-and-replace pattern before running it in your editor.
Tips
- This uses the JavaScript regex engine, so test patterns here exactly as they'll behave in JS.
- Escape special characters like . * + ? ( ) [ ] with a backslash when you mean them literally.
Frequently asked questions
Which regex engine does this use? +
The JavaScript (ECMAScript) regex engine, so patterns behave here exactly as they will in JS running in a browser or Node.
Is my text processed privately? +
Yes. Your pattern and sample text are evaluated entirely in your browser — nothing is uploaded.
How do I match a literal special character? +
Escape it with a backslash. Characters like . * + ? ( ) [ ] { } ^ $ | have special meaning, so precede one with a backslash when you want to match it literally.