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
/
^([0-9]{3})-?([0-9]{3})-?([0-9]{3})-?(?<LAST>[0-9]{3})?(?(<LAST>)<LAST>)$
/
gm
Input 1
009026405 01009556500 226-356-839 00829029200 008-018-454 009-513-213 00383951900 000147765000
Substitution
009026405 01009556500 226-356-839 00829029200 008-018-454 009-513-213 00383951900 000147765000