正则表达式的问题??
var ss = "Is is the cost of of gasoline going up up?.\n";
var re = /\b([a-z]+) \1\b/gim;
var rv = ss.replace(re,"$1"); //为什么会一个单词替代两个单词???
返回的是 Is the cost of gasoline going up?
$1 的值是怎么取的?
这是怎么匹配的,总是看不懂!!
如果ss 改为:"Is is is the cost of of of gasoline going up up up?.\n"
返回的怎么是 Is is the cost of of gasoline going up up?
如果要返回 Is the cost of gasoline going up?
re 该怎么写
还有就是re 中的 \1 改为 \2 什么就不行啦