Regex Tester
Type a regular expression and some test text to see each match, where it starts and what each group captured. Turn on replace to preview the result. Your text stays in your browser.
Runs in your browser. Nothing you type is uploaded.
Result
/(?<user>[\w.+-]+)@(?<domain>[\w-]+\.[\w.]+)/g. Flags: g (global: find every match).
| # | Index | Match | Groups |
|---|---|---|---|
| 1 | 8 | jane@acmenotes.com | 1: jane · 2: acmenotes.com · user: jane · domain: acmenotes.com |
| 2 | 41 | support@pixelforms.io | 1: support · 2: pixelforms.io · user: support · domain: pixelforms.io |
| 3 | 86 | j.doe+news@mail.example.co.uk | 1: j.doe+news · 2: mail.example.co.uk · user: j.doe+news · domain: mail.example.co.uk |
How it works
- JavaScript flavor
- Patterns run with the same regex engine as JavaScript in your browser, so what matches here matches in your code.
- Matches and groups
- Each row shows where a match starts (counting from 0), the matched text, and what each numbered or named group captured.
- Limits
- The tester stops after 1,000 matches and limits test text to 50,000 characters, which keeps slow patterns from freezing the page for long.
Questions
Why do I only get one match?
Add the g flag. Without it, JavaScript stops after the first match.
How do I use a group in the replacement?
Write $1 for the first group, $2 for the second, or $<name> for a named group. $& inserts the whole match.
Why does my pattern from another language fail?
Regex flavors differ. JavaScript does not support possessive quantifiers or inline flags like (?i), for example. Use the flags box instead.
Get CapyLaunch Weekly
New indie launches and the week in AI tools and models, every Monday. Free, and you can unsubscribe anytime.
Your launch, this week. Free.
A reviewed listing, a permanent page with a link to your site, and feedback from makers who actually care.