var str = ",aaa,bbb?ccc,ddd?hhh";
var re = /,(\w+)/ig;
var arr = [];
var re1 = /\?(\w+)/ig;
var arr1 = [];
while(re.exec(str))arr.push(RegExp.$1);
while(re1.exec(str))arr1.push(RegExp.$1);
alert(arr);
alert(arr1);
var re = /,(\w+)/ig;
var arr = [];
var re1 = /\?(\w+)/ig;
var arr1 = [];
while(re.exec(str))arr.push(RegExp.$1);
while(re1.exec(str))arr1.push(RegExp.$1);
alert(arr);
alert(arr1);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货