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
/
^(?:[A-Z0-9]|(?<=[0-9])[a-z])*$
/
gm
Input 1
New
These are expected matches: AA AB 1a 1b 1A 1B A1A A1a AB1 AB2 AB1a AB2b These would fail: Aa Ab a1 b1 Ab1 a1a
Substitution
These are expected matches: AA AB 1a 1b 1A 1B A1A A1a AB1 AB2 AB1a AB2b These would fail: Aa Ab a1 b1 Ab1 a1a