js常用操作~~~~将持续更新

1.替换多个模板变量

 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")); //输出 his javascript was very poor,who could help me?


  

posted @ 2019-06-18 15:48  牧码人hhom  阅读(134)  评论(0编辑  收藏  举报