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
r"
(?<![A-Z0-9])@([A-Z][A-Z0-9_]*[A-Z0-9])
"
gi
Input 1
1
Accept and return @something but reject first@last.
Substitution
Accept and return @something but reject first@last.