I am looking for regular expression that would allow only positive integers(1-9)excluding 0 and alphabets. It can accept 01, 10 , 201 . It should not accept 0 , 00, 000.... I had tried most of the regular expressions available on google. But nothing worked. Pls help.
Regular expression that would allow numbers from 1-9 excluding 0 and alphabets
55 views Asked by radha At
3
There are 3 answers
0
On
Can be simplified like
0?[1-9][0-9]+
Check out http://regexpal.com it's online regex - can save a lot of time debugging
0*(1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)*