Skip to content

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.

#MatchAtGroups
1asha@example.com9user: asha, domain: example.com
2support@skill-demo.org29user: 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

  1. Type a pattern without the surrounding slashes, and choose flags such as i for case-insensitive or m for multiline.
  2. 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

All developer tools →