i want a reg exp for the below format..
1.0.00.0000

i tried as follows
\d\.\d\.\d{2}\.\d{4}

but it's accepting -ves numbers also(-1.0.00.0000)
I want only +ve numbers in my input..how do i check it?

Re: help on regex by guffa

guffa
Tue Jun 05 10:24:19 CDT 2007

AVL wrote:
> i want a reg exp for the below format..
> 1.0.00.0000
>
> i tried as follows
> \d\.\d\.\d{2}\.\d{4}
>
> but it's accepting -ves numbers also(-1.0.00.0000)
> I want only +ve numbers in my input..how do i check it?

You have to match the beginning and ending of the string also, otherwise
you will only be checking if the pattern can match a part of the string.

^\d\.\d\.\d{2}\.\d{4}$

--
Göran Andersson
_____
http://www.guffa.com