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,1}[0-9]+[\.][0-9]+|[\-]{0,1}[0-9]+$
/
g
Unit Tests
-99.
→ regex does not match
-156.12
→ regex does match
-1.01
→ regex does match
-10
→ regex does match
1.99
→ regex does match
1.
→ regex does not match
9999999
→ regex does match
0
→ regex does match
1.0
→ regex does match