REGEX question

REGEX question

am 20.12.2007 20:33:08 von pvong

Can someone help me write a regex that will accept number but NO COMMAS.

Yes to
123456.78

No to
123,456.78

Thanks!
Phil

Re: REGEX question

am 20.12.2007 20:38:53 von lexa

On Dec 20, 8:33 pm, "pvong" wrote:
> Can someone help me write a regex that will accept number but NO COMMAS.
>
> Yes to
> 123456.78
>
> No to
> 123,456.78
>

Hi Phil,

Do you need it for the RegularExpressionValidator control?

Try this one

^\d+(\.\d\d)?$

Hope it works

Re: REGEX question

am 20.12.2007 20:44:03 von lexa

On Dec 20, 8:38 pm, Alexey Smirnov wrote:
> On Dec 20, 8:33 pm, "pvong" wrote:
>
> > Can someone help me write a regex that will accept number but NO COMMAS.
>
> > Yes to
> > 123456.78
>
> > No to
> > 123,456.78
>
> Hi Phil,
>
> Do you need it for the RegularExpressionValidator control?
>
> Try this one
>
> ^\d+(\.\d\d)?$
>
> Hope it works

If the digits after the decimal point are always there:

^\d+\.\d\d$

Re: REGEX question

am 20.12.2007 20:53:17 von pvong

Yes and this is perfect!!!!
Thanks!


"Alexey Smirnov" wrote in message
news:d832fb24-e3b9-446d-8121-cc02a4807eab@i3g2000hsf.googleg roups.com...
> On Dec 20, 8:33 pm, "pvong" wrote:
>> Can someone help me write a regex that will accept number but NO COMMAS.
>>
>> Yes to
>> 123456.78
>>
>> No to
>> 123,456.78
>>
>
> Hi Phil,
>
> Do you need it for the RegularExpressionValidator control?
>
> Try this one
>
> ^\d+(\.\d\d)?$
>
> Hope it works
>