Floating Point Numbers
The following regular expressions can be used for matching floating point numbers:
Expression:[-+]?\b[0-9]+(\.[0-9]+)?\b
Description:
Matches an integer or a floating point number with mandatory integer part. The sign is optional.
Test Matches:
123456 1 2 3 4 5 6 +123456 -123456 123. .456 1,234.56 123.456 +123.456 -123.456
Expression:
[-+]?\b[0-9]*\.?[0-9]+\b
Description:
Matches an integer or a floating point number with optional integer part. The sign is optional.
Test Matches:
123456 1 2 3 4 5 6 +123456 -123456 123. .456 1,234.56 123.456 +123.456 -123.456