Home > other >  Regex for number not starting with 0 and MAX 10 digit
Regex for number not starting with 0 and MAX 10 digit

Time:11-17

I am trying a regex for the number which should not start with 0 and can have maximum 10 digits, I tried the following regex but it is not working

 1. ^([1-9] )([0-9] ){1,10}$
 2. ^(([1-9]) ([0-9]) {1,10})$
 3. ^([1-9] )([0-9]*){1,10}$

but it is not working

CodePudding user response:

You can try

^[1-9]{1,10}$

See a demo

  • Related