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]+)-?)+[^-][0-9]*$
/
Unit Tests
10-50-30-20
→ regex does match
10-50--30-20-58
→ regex does not match
10
→ regex does match
10--
→ regex does not match
10-30-45-
→ regex does not match
Vazio