From: Greg Pelly [EMAIL PROTECTED]
Here's a better mask to use:
var
var-namemask/var-name
var-value^\$?\d+(,\d{3})*(\.\d{2})?$/var-value
/var
This is *perfect*! Thanks also to Hubert for reminding me about 'mask' in
the first place. :)
--
Wendy Smoak
I'm useless with regex. However, I found this on the web some time
ago and seemed to match what I needed back then:
var
var-namemask/var-name
var-value^(?:\d+|\d{1,3}(?:,\d{3})*)(?:\.\d{1,2}){0,1}$/var-value
/var
This allows them to include the .00 if they so desire.
hth,
Hubert
On
($1,500,200.99)) {
alert ('matches');
} else {
alert ('does not match');
}
/script
HTH,
Greg
-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 06, 2005 3:39 PM
To: Struts Users Mailing List
Subject: Re: Validating an amount with commas
3 matches
Mail list logo