R
Rajesh Patra

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 matches

Highlighted Matches

Contact us at hello@example.com or admin@site.org

Match Details

#MatchIndexGroups
1hello@example.com14helloexample.com
2admin@site.org35adminsite.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 group
a|bOR
a*0 or more
a+1 or more
a?0 or 1
a{3}Exactly 3
a{2,4}2 to 4
a*?Lazy match