Developer Tool
Regex Tester
Test a JavaScript regular expression against sample text and see every match and group.
Runs in your browser — nothing is uploaded
//g
2 matches
Write to asha@example.com or support@skill-demo.org for help.
| # | Match | At | Groups |
|---|---|---|---|
| 1 | asha@example.com | 9 | user: asha, domain: example.com |
| 2 | support@skill-demo.org | 29 | user: support, domain: skill-demo.org |
What this does
Regular expressions describe patterns in text, and they are much easier to get right when you can see what they match as you type. This tool runs your pattern with your browser's own JavaScript regular expression engine against sample text, highlights each match, and lists every capture group, including named groups.
Because it uses JavaScript's engine, it shows exactly how the same pattern will behave in JavaScript or TypeScript code.
How to use it
- Type a pattern without the surrounding slashes, and choose flags such as i for case-insensitive or m for multiline.
- Paste the text you want to search. Matches are highlighted and listed underneath with their positions and groups.
Where it stops being right
- Regular expression syntax differs between languages. A pattern that works here may behave differently in Python, Java or grep.
- Some patterns with nested repetition can take so long on certain inputs that the browser tab stops responding. If that happens, simplify the pattern and reload the page.
- The match list stops at the first 1,000 matches.
Questions
- Why does my pattern match more than I expected?
- Quantifiers like * and + are greedy by default and match as much as they can. Adding ? after them, as in .*?, makes them match as little as possible.
- What does the g flag do?
- It finds every match rather than stopping at the first. This tool always lists all matches, so the flag mainly matters when you copy the pattern into code.
- Is my text sent anywhere?
- No. Matching happens in your browser.
More developer tools
- Case ConverterConvert names between camelCase, snake_case, kebab-case, PascalCase and more.
- Word & Character CounterCount words, characters, lines, bytes and reading time as you type.
- JSON Formatter & ValidatorPretty-print, minify and check JSON, with the position of any syntax error.
- Base64 Encoder & DecoderConvert text to Base64 and back, with correct handling of non-English characters.