Title |
Test
Find
Pattern Title
|
Expression |
^(?!\u00a2) #Don't allow cent symbol
\p{Sc}? #optional unicode currency symbols
(?!0,?\d) #don't allow leading zero if 1 or more unit
(?:\d{1,3} # 1 to 3 digits
(?:([, .])\d{3})? # if there is a separator it must be followed by 3 digits
(?:\1\d{3})* # if the is more than two groups the same separtor must but used, it must be followed by 3 digits
|(?:\d+)) # more than 3 digit with no comma separator
((?!\1)[,.]\d{2})?$ # option cents |
Description |
Internationally capable currency formats. It is NOT local aware. Should be modify for local specific validations.
More detail at http://blogs.regexadvice.com/mash/archive/2004/06/08/1246.aspx |
Matches |
$9,876,543.21 | €9 876 543,21 | €9.876.543,21 |
Non-Matches |
9.876.543.21 | 9,876,543,21 | 9 876 543 21 |
Author |
Rating:
Not yet rated.
Michael Ash
|
Source |
|
Your Rating |
|
Title: French format
Name: Toni
Date: 5/19/2005 7:41:54 PM
Comment:
In java the space should be escaped:
(?:([,.\ ])\d{3})?