What is the regex for “Any positive integer, excluding 0”

Try this:

^[1-9]\d*$

…and some padding to exceed 30 character SO answer limit :-).

Here is Demo

Leave a Comment