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
/
^\b\d?(?:[A-Z]\d)*[A-Z]?$
/
gm
Input 1
1
New
D1B2C4Q3 DDA1Q3 D$1A2B 1 11 A AA 1A2B 1AA2 B2C33 B2C3D4 B2C3D4EE B2C3D4E5G
Substitution
D1B2C4Q3 DDA1Q3 D$1A2B 1 11 A AA 1A2B 1AA2 B2C33 B2C3D4 B2C3D4EE B2C3D4E5G