Title |
Test
Find
Pattern Title
|
Expression |
^\-?\(?([0-9]{0,3}(\,?[0-9]{3})*(\.?[0-9]*))\)?$ |
Description |
Match a positive or negative decimal value with any precision and scale. Allows for left-padded zeroes, commas as group separator, negative sign (-) or parenthesis to indicate negative number. |
Matches |
0.123 | (1234.123) | -01,200 |
Non-Matches |
2.3.123 | 1,23.45 |
Author |
Rating:
Not yet rated.
Rich Franzmeier
|
Source |
|
Your Rating |
|
Title: Good with decimals and group separators
Name: vertex
Date: 8/3/2007 6:06:19 PM
Comment:
This works well with formatted decimals that include group separators.
Title: user
Name: user
Date: 8/12/2005 1:33:15 PM
Comment:
can handle (9,000)
but can't handle (9,000
missing closing parenthesis.
Title: user
Name: user
Date: 1/26/2005 11:44:57 AM
Comment:
Very good Thanks a million.
I was looking for a regex like this, but which will only allow integers. This one allows floats with decimals. But I will still take it.
Title: Decimal with any precision and scale
Name: Decimal
Date: 12/6/2004 12:10:45 PM
Comment:
Matches positive or negative number with any precision/scale, leading zeroes.