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
/
\G((?:.\D)*.)\d
/
g
Input 1
1
New
a1b2cde3~g45hi6 Match any char with a non digit ( This is to ensure that the /G carries on to the next pair) store any char in \1 Match any digit
Substitution
$1*