[thelist] numeric with 2 decimal in javascript regular expression

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Tue Sep 27 05:37:10 CDT 2005


^\d*(\.\d{1,2})?$

matches:

123
123.1
123.12

not matches

123.
123.123

HTH,
Volkan.

2005/9/27, demy more <dialforpaul at yahoo.co.in>:
> Hi ,
>
> I am facing a problem regarding java script regular
> expression .
> I need regular expression for numeric field which will
>
> allow me to accept only 2 decimal . ex : 11.11 allowed
>
> but 11.111 not allowed .
>  I have given like this
> /^d[0-9.]+$/
> Then how to proceed . it is allowing me any decimal
> number . But I only need 2 decimal  .
>
> Can any body help me in this regards
>
> Asit
>
>
>
>
> __________________________________________________________
> Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


More information about the thelist mailing list