A Regular Expression to check if the number you provide is a float value.
/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/
Matches:
- 12345
- -123.45
- 123.45e-5
Non-matches:
- abcd
- 123.45e
- 12.34.56
See Also:
Rate This Regex
User Review
( votes)Expression Flags
Flags | Description |
---|---|
i |
Ignore case sensitive. |
g |
Allows global search. |
m |
Allows multiline search. |