//字符串
var str='<img src="https://fhfgjfdh/2.gif" alt="/::B">hello<img src="https://idufid/emotion/3.gif" alt="/::|">';
//正则
var preg=/<img(.+)alt="/ig;
//替换为空
str=str.replace(preg,'');
我想得到的结果是/::B">hello/::|">,但现在结果为/::|",要怎么修改呢?
慕尼黑5688855
人到中年有点甜
随时随地看视频慕课网APP
相关分类