js replace(/(.*)(addSpec)(.*)(\[)(\+)/i,"$1removeSpec$3$4-")

问题描述:

js replace(/(.*)(addSpec)(.*)(\[)(\+)/i,"$1removeSpec$3$4-")

将{x1}addSpec{x2}[+ 替换成{x1}removeSpec{x2}[- ,其中{x1},{x2}代表任意字符串