<script type="text/javascript"> var str="Visit Microsoft!" document.write(str.replace(/Microsoft/, "W3School")) </script>输出
str.replace(/Microsoft/, "W3School")
Visit W3School!