首页 > TAG信息列表 > searchSegment
冷知识 javascript 对特殊符号的转义顺序
//反斜杠转移写在最前面,这样就不会影响后面的转换 searchSegment = searchSegment.replace(/\\/g, "\\\\"); searchSegment = searchSegment.replace(/\+/g, "\\+").replace(/\-/g, "\\-").replace(/\?/g, "冷知识 javascript 对特殊符号的转义顺序
//反斜杠转移写在最前面,这样就不会影响后面的转换 searchSegment = searchSegment.replace(/\\/g, "\\\\"); searchSegment = searchSegment.replace(/\+/g, "\\+").replace(/\-/g, "\\-").replace(/\?/g, "