var reg = /d[*]/;//中括号中的*不用转义 console.log(reg.exec("d"));//null console.log(reg.exec("d*"));//["d*",index: 0,input: "d*"]原文链接:https://www.f2er.com/regex/360894.html
var reg = /d[*]/;//中括号中的*不用转义 console.log(reg.exec("d"));//null console.log(reg.exec("d*"));//["d*",index: 0,input: "d*"]原文链接:https://www.f2er.com/regex/360894.html