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
"
^(\d)(?!\1{3}-\1$)\d{3}-\d$
"
gm
Input 1
1
New
0000-0 0000-1 1111-1 1234-2 1234-2- 1234-2-3
Substitution
0000-0 0000-1 1111-1 1234-2 1234-2- 1234-2-3