Title |
Test
Find
Pattern Title
|
Expression |
(^(\d+)$)|(^(\d{1,3}[ ,\.](\d{3}[ ,\.])*\d{3}|\d{1,3})$) |
Description |
Searches for number greater than 0 with thousand delimiter as space, comma or period. |
Matches |
1 234 567 | 1.234.567.890 | 1,234 |
Non-Matches |
-12,990 | 100.03 | 0,05 |
Author |
Rating:
Not yet rated.
Peter Petrus
|
Source |
|
Your Rating |
|
Title: Improved grouped number recognition
Name: Stephen Samuel
Date: 6/1/2007 6:30:28 PM
Comment:
This pattern matches a number with thousands delimiters, but ensures that the delimiters aren't switched around.
/^\d{1,3}(([ ,.]?)\d{3}(\2\d{3})*)?$/
allowed: 123,456,789 | 123 456 | 3.456 | 3456
rejected: 123,567.789 | 123.456 789