js正则匹配以$开头和结尾的内容,并改变颜色 12345 let res = "$你好你好$"res = res.replace(/\$(?<=\$).*?(?=\$)\$/g, `<span onclick="((params)=>{ console.log(params) })('$&')" style="color: dodgerblue;padding: 0 5px;">$&</span>`) 2023-06-27by SKILLNULL JavaScript, 前端 阅读(2274)评论(0)