I need an regular expression pattern to only accept positive whole numbers. It can also accept a single zero.
I do not want to accept decimals, negative number and numbers with leading zeros.
Any suggestions?
I need an regular expression pattern to only accept positive whole numbers. It can also accept a single zero.
I do not want to accept decimals, negative number and numbers with leading zeros.
Any suggestions?
"[1-9][0-9]*|0"
I'd just use "[0-9]+" to represent positive whole numbers.