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
r"
^[+-]?\d+(?:\.\d*)?(?<!.{6})
"
gm
Input 1
1
New
123 -> 123 1.23 -> 1.23 123456 -> 12345 +12.34 -> +12.3 -12.34 -> -12.3 1.2-3 -> 1.2 1.2.3.4 -> 1.2 ....