Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.5k views
in Technique[技术] by (71.8m points)

IE 浏览器下 match 方法报错

遇到一个字符串使用 match 正则比配的问题。
`
let reg = /(?<={{2}).*?(?=}{2})/g;
let res = '{{abc}}'.match(reg);
`

chrome 浏览器运行正常,IE 浏览器会报 Unexpected quantifier
看网上解释说是最好 避免在字符串方法中使用预匹配正则。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

IE不支持后行断言IE不支持后行断言


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...