
January 16th, 2004, 08:22 AM
|
|
Contributing User
|
|
Join Date: Jun 2003
Location: Newfoundland, Canada
Posts: 97
Time spent in forums: 1 h 23 m 15 sec
Reputation Power: 6
|
|
|
Custom Validation Regular Expression (money)
I'm using a Custom Validation Control in ASP.NET and am trying to write the regular expression to recognize money. The entry may or may not contain $, it may or may not contain comma's, it may or may not include the cents(.##), and it must have at least one digit. So this is what I came up with (I have no previous regular expression experience and it will probably show)
\$?[0-9]+(\,[0-9]{3}]*(\.[0-9]{2})?
I'm trying to say
0 or more $ followed by
1 or more digits from 0 to 9 followed by
0 or 1 comma's followed by three digits from 0 - 9 followed by
0 or 1 period's followed by two digits
Its not recognizing anything that I try .... Any help is greatly appreciated.
Thanks.
|