I need a regex to validate integer numbers. 05 and 00
are not allowed but 0
is allowed.
Currently I have this:
/^[1-9]\d*$/
But it does not allow 0
. Thanks for help.
^(?:[1-9]\d*|0)$
This is your pattern...
Your regex should be ^(?!0.)\d+$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With