Firefox 是不是不支持正则表达式的“后顾”匹配呢?
資深大佬 : ljxok2001 4
“中国人”.replace(/(?<=中国)人 /, “rr”)
用以上语句,在 chrome 正常执行, firefox 报错:SyntaxError: invalid regexp group 。
firefox 不支持这种写法:(?<=exp2)exp1
还是说 firefox 有其他写法的
大佬有話說 (3)
“中国人”.replace(/(?<=中国)人 /, “rr”)
用以上语句,在 chrome 正常执行, firefox 报错:SyntaxError: invalid regexp group 。
firefox 不支持这种写法:(?<=exp2)exp1
还是说 firefox 有其他写法的
https://caniuse.com/#feat=js-regexp-lookbehind