Regex Tester

No upload · runs in your browser
//gm
Flags
Test string
Highlighted matches
Support tickets this week:

  [email protected] opened #412 (billing)
  [email protected] opened #413 (login)
  not-an-email@ opened #414, malformed, ignore
  [email protected] and [email protected] both replied
Matches
4
Unique
4
Capture groups
2
Characters matched
92
Match details
#IndexMatchGroups
130[email protected]
user: ada.lovelacedomain: example.com
279[email protected]
user: sam+betadomain: dev.example.co.uk
3175[email protected]
user: gracedomain: example.org
4197[email protected]
user: jane.doedomain: mail.example.com
Cheat sheet
.any character except newline (any character at all with the s flag)
\d \w \sdigit, word character, whitespace
\D \W \Sthe negation of each of the above
[abc] [^abc]one of these characters / anything but these
a{2,5}between two and five of a
a* a+ a?zero or more, one or more, optional
a+?lazy, match as few as possible
^ $start and end of the string, or of a line with the m flag
\bword boundary
(abc)capture group, referenced later as \1
(?:abc)group without capturing
(?<year>\d{4})named capture group
a|beither a or b
(?=abc) (?!abc)lookahead: followed by / not followed by
(?<=abc) (?<!abc)lookbehind: preceded by / not preceded by
\. \$ \(escape a character that would otherwise be special

Patterns are compiled and run in your browser, no pattern or test text is uploaded.

How it works

Regex Tester : Live Match Highlighting and Capture Groups

Write a pattern, flip the flags, and watch every match light up in your test string as you type. Capture groups and named groups are broken out in a table underneath.

What this does
  • Every match lights up in the test string as you type the pattern
  • All six JavaScript flags as independent toggles, g, i, m, s, u, y
  • Match table giving the start index of each match alongside its capture groups
  • Named groups from (?<name>…) labelled by name rather than by number, read out of the pattern itself
  • Compile errors rewritten in plain English: “Nothing to repeat” explains which quantifier has nothing before it
FAQ

Your browser’s own RegExp, so what matches here is what Node and front-end code will do.

Keep going