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]{5})-([\d]{7})-([\d]{1}))|(([\d]{5})([\d]{7})([\d]{1}))|(([\d]{5}) ([\d]{7}) ([\d]{1}))$
"
gm
Input 1
New
// Allow these: 1234512345671 12345-1234567-1 // Don't Allow 12345 1234567-1 12345-1234567 1 12345123456718 12345-1234567-71 12345-12345678-1
Substitution
// Allow these: 1234512345671 12345-1234567-1 // Don't Allow 12345 1234567-1 12345-1234567 1 12345123456718 12345-1234567-71 12345-12345678-1