var reg =/(\w)(\w)\1\2/g; var str ='abab' console.log(str.replace(reg,function($,$1,$2){ return $2+$1+$2+$1 }))
本文标题:aabb 输出 baba
本文链接:https://www.haomeiwen.com/subject/csqiuqtx.html
网友评论