标签:
var str = ‘123,125,236,123,34568‘; var reg = /^(\d+,?)+$/; console.log(reg.test(str));
if(reg.test(str)){ console.log("输入合法"); }else{ console.log("输入bu合法"); }
js 正则匹配数字,逗号分隔
原文地址:http://www.cnblogs.com/kokier/p/5680337.html