How to validate positive integer numbers using ng-pattern
. Now i have this pattern ^[0-9]{1,7}(\.[0-9]+)?$/
. But it allows decimal values. I need to disallow decimal values too
答案 0 :(得分:1)
Very Simple! Just use ^\d+$
where, decimals won't be allowed
答案 1 :(得分:0)
try this in ng-pattern ^\-?\d+$
and not accept any -values
答案 2 :(得分:0)
Positive integers without leading zeros: ^[1-9]\d+$
答案 3 :(得分:0)