I need a regex to allow either a single 0 or any other number of digits that do not start with zero so:
0 or 23443 or 984756 are allowed but 0123 is not allowed.
I have got the following which allows only 1 to 9
[1-9]\d
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Look for a lone 0 or 1-9 followed by any other digits.
If you want to match numbers inside of larger strings, use the word boundary marker
\bin place of^and$: