js全局正则替换html字符串中的闭合标签 web前端攻城狮 2019-07-13 802 阅读1分钟 let newStr=string.replace(/<[/]?(u)([^<>]*)>/g, (m)=>m.replace('u', 'span')); //将u标签替换为Span