<div class="codetitle"> <span><a style="CURSOR: pointer" data="30103" class="copybut" id="copybut30103" onclick="doCopy('code30103')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code30103"> <br>var s="abachdas"; <br>var s2=s.replace(new RegExp(/(a)/),'b');//将s中所有a替换成b <br> </div>