求一个批量替换指定字符串正则表达式

2024-11-17 11:32:47
推荐回答(1个)
回答1:

var str = `href="<%linkurl("userorder","list")%>">`;
str.replace(/\"(<.+>)\"/,"'$1'");
//href='<%linkurl("userorder","list")%>'>