<script> var s="my javascript is very poor,who can help me?" var reg=/(\w*)my(.*)is(.*)can(.*)/g alert(s.replace(reg,"$1his$2was$3could$4")); </script>
参考链接:http://bbs.csdn.net/topics/320097246