Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
@"
\b([A-Z]+)0(?=[1-9]\d{2}\b)
"
gm
Input 1
1
New
SK0498 should return SK498 (total digits = 4 = omit the single leading zero) AA007 should still return AA007 (because the leading zeros are double, and total digits is only 3) UA2138 returns UA2138 (no leading zeros involved) BA023 should return BA023 (keep the zero because total number of digits is only 3), however BA0234 should return BA234 (total digits is 4 with a single leading zero that should be omitted).
Substitution
$1