var angelweb="我,你,ta,";
var re=/[,,]/g;
if(re.test(angelweb)){
var n=angelweb.match(re).length;
alert("字符串中包含"+n+"个逗号!");
}
转载于:https://www.cnblogs.com/xsj1989/p/5129761.html
var angelweb="我,你,ta,";
var re=/[,,]/g;
if(re.test(angelweb)){
var n=angelweb.match(re).length;
alert("字符串中包含"+n+"个逗号!");
}
转载于:https://www.cnblogs.com/xsj1989/p/5129761.html