Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?:(?<=^|[^\w])(?<!@)@)([\w.]*[\w])(?=[^\w@]|$)(?!@)
/
Unit Tests
asdfasf
→ regex does not match
asdf
a
@
asdfasf
→ regex does not match
asdlk
@@asldf
alkdx
→ regex does not match
@toto
→ regex does match
@toto.tata
→ regex does match
@tadm:
alsd
→ regex does match
@toto;
aldsf
→ regex does match
@tadm/@ted
→ regex does match
check
@tadm<br>
sldk
→ regex does match
xxx@example.com
→ regex does not match
tadm@
→ regex does not match
@xxx&%%%
→ regex does match
@xxx@localhost.com
→ regex does not match
@xxx@localhost
→ regex does not match
@toto_tata
→ regex does match
@tata.
sldk
→ regex does match
@toto.
→ regex does match