Regex Tester & Explainer
Test regular expressions with live match highlighting, capture group details, and plain-English explanations for each token.
Regular Expression
//g
Flags
Examples
Test String
2 matchesHighlighted Matches
Contact us at hello@example.com or admin@site.org
Match Details
| # | Match | Index | Groups |
|---|---|---|---|
| 1 | hello@example.com | 14 | helloexample.com |
| 2 | admin@site.org | 35 | adminsite.org |
Pattern Breakdown
(Capture group #1 — stores this part of the match
\wAny word character (a–z, A–Z, 0–9, _)
+One or more of the preceding element (greedy — as many times as possible)
)End of group
@Literal character: "@"
(Capture group #2 — stores this part of the match
\wAny word character (a–z, A–Z, 0–9, _)
+One or more of the preceding element (greedy — as many times as possible)
\.Escaped literal: "."
\wAny word character (a–z, A–Z, 0–9, _)
+One or more of the preceding element (greedy — as many times as possible)
)End of group
Token Legend
anchor
literal
shorthand
quantifier
group
class
alternation
special
Quick Reference
.Any char (except \n)\dDigit 0–9\wWord char\sWhitespace\bWord boundary^Start of string$End of string[abc]Char class[^abc]Negated class(abc)Capture group(?:abc)Non-capture groupa|bORa*0 or morea+1 or morea?0 or 1a{3}Exactly 3a{2,4}2 to 4a*?Lazy match