Regex Tester
Test JavaScript regular expressions and inspect matches and groups.
Runs entirely in your browser using JavaScript regular expressions. Your text is never uploaded. The share link contains the pattern and flags, and your text only if it is 300 characters or fewer.
Pattern
JavaScript (ECMAScript) syntax. Results update as you type.
g
Test text
2 matches found
Matches are shaded. Capture groups get their own colour and an underline, so colour is never the only cue.
- Match 1index 8length 15
ada@example.com
1 userada2 domainexample.com - Match 2index 27length 21
grace.hopper@navy.mil
1 usergrace.hopper2 domainnavy.mil
About this tool
Test a JavaScript regular expression against sample text with live highlighting. See every match, its position and capture groups, get a plain-English explanation of the pattern, try replacements, and start from a library of common patterns.
How to use it
- Enter a pattern and toggle the flags.
- Enter the text to test; matches highlight as you type.
- Review the match list and the explanation, or use the Replace tab.
- Copy the share link to send the pattern to someone.
Frequently asked questions
- Why does it only test part of my text?
- Some patterns, such as nested quantifiers, can freeze a browser tab. For those, only the first few characters are tested until you choose to run it on the full text.
- Which regex flavour is used?
- The JavaScript (ECMAScript) engine of your browser. Other languages may behave differently for some features.