正则表达式把Paul换成Ringo<script>var str='Paul,Paula,paul,Ppaul,Paul';//字符串var result=str.replace(/\bPaul\b/g,"ringo");//将字符串中的Paul单词替换成ringodocument.write(result);</script>运行结果为:ringo,Paula,paul,Ppaul,ringo