js判断正整数

var r = /^+?[1-9][0-9]*$/;  //判断正整数 
r.test(str);
原文地址:https://www.cnblogs.com/shenyixin/p/5230987.html