日期:2014-05-16 浏览次数:20320 次
var s="@2+@3+@4-(8+@5)*0.2"
var m=s.match(/@\d+/g);
if(m)for(var i=0;i<m.length;i++)m[i]=m[i].substring(1)
alert(m)
var s="@2+@3+@4-(8+@5)*0.2";
var $r = /\@\d+/g;
var $m = s.match($r);
var $len = $m.length;
var $mm=[];
for(var i=0;i<$len;i++){
$mm.push(String.prototype.slice.call($m[i],1));
}
var s="@2+@3+@4-(8+@5)*0.2";
var reg = /@(\d+)/g;
var arr,gols=[];
while(arr = reg.exec(s)) {
gols.push(arr[1]);
}
alert(gols);