var str=" one two three four";
var re=/^(\s*(\w+)){3}/;
var arr=re.exec(str);
alert(arr);
arr的输出是one two three, three,three;这是为什么?
one two three输出很容易理解,可后两个我总也想不明白
...全文
592打赏收藏
请教Javascript中正则表达式的问题,一晚上也弄明白
var str=" one two three four"; var re=/^(\s*(\w+)){3}/; var arr=re.exec(str); alert(arr); arr的输出是one two three, three,three;这是为什么? one two three输出很容易理解,可后两个我总也想不明白