Try regex:
(?=[^\0])(?=^([0-9]+){0,1}(\.[0-9]{1,2}){0,1}$)
Allowed: 1, 10.8, 10.89, 0.89, 0.89, 1000
Not allowed: 20., 50.89.9, 12,999,., Zero character Please note that this works for positive numbers
Harshit Sinha Aug 05 '16 at 6:50 2016-08-05 06:50
source share