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+\.\d+(?:\.\d+){0,1})-){0,1}(\d+(?:\.\d+)*)
/
g
Input 1
1
New
1.0.0 1.2.3.4 1.0 1.7.10-1.2.3 1.8.1-10.0.0.1 1.10.10-2 1.5-4.63.2
Substitution
1.0.0 1.2.3.4 1.0 1.7.10-1.2.3 1.8.1-10.0.0.1 1.10.10-2 1.5-4.63.2