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
/
^(?:([\p{Lu}0-9_]{2,})|(\p{Lu}[\p{L}0-9_$]+)|([\p{L}_$][\p{L}0-9_$]*))\b
/
mg
Unit Tests
Constant
Class
Other Generic
Numerical first character is invalid
Cut-off at invalid character
$CONSTANT == Generic
$ClassName == Generic
VARName == Class
SomeNAME == Class
ÜBER == Constant
PLAYER1 == Constant
PLAYER_2 == Constant
Type0 == Class
A1 == Constant
B == Generic
c == Generic