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!
See Question&Answers more detail:osI 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!
See Question&Answers more detail:osI 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.