struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "alexj" <al...@freesurf.ch>
Subject Re: [OT] need help in regex expression
Date Thu, 06 Mar 2003 00:59:28 GMT
[+-][0-9]{0-9}("."{0-9})----- Original Message ----- 
From: "Ashish Kulkarni" <kulkarni_ash1312@yahoo.com>
To: <struts-user@jakarta.apache.org>
Sent: Thursday, March 06, 2003 1:48 AM
Subject: [OT] need help in regex expression


> Hi,
> 
> I have to validate a double field, which can be
> negative or positive, has max 4 digits in integer and
> max 2 digits after decimal, 
> I have the following regex which handles some cases
> but need help to make it work in all casses
> 
> \b[\d]?[\d]?[\d]?[\d]?\b[\.,]?[\d]?[\d]?
> it works in
> 1234.56
> 123.45
> 2334
> 0.34
> but does not work 
> .34
> 
> and also i want it work for
> -123.45
> +234.45
> 
> Can any one suggest a way to modify expression or
> write it in better way
> 
> Ashish
> 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message