1.大于0的数
var reg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/;
reg.test('2');
-- 可以输入数字加.
var reg2 = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.$|\d+\.\d+)$/;
reg.test('0.');
1.大于0的数
var reg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/;
reg.test('2');
-- 可以输入数字加.
var reg2 = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.$|\d+\.\d+)$/;
reg.test('0.');