I am trying to create an input regex that will only accept whole, positive numbers. So far I have:
[^[+]?\d+([.]\d+)?$]
But users can still enter, say, .4. How can I alter this to disallow floats? Thanks!
I am trying to create an input regex that will only accept whole, positive numbers. So far I have:
[^[+]?\d+([.]\d+)?$]
But users can still enter, say, .4. How can I alter this to disallow floats? Thanks!
This allows only positive numbers
^[0-9]+$
I think you try to filter only positive integers.
^[1-9]\d*$
allows only positive integer numbers. What is the regex for "Any positive integer, excluding 0" will also help you.