struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashish Kulkarni <kulkarni_ash1...@yahoo.com>
Subject [OT] need help in regex expression
Date Thu, 06 Mar 2003 00:48:52 GMT
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


Mime
View raw message