微信小程序的js不支持正则表达式的零宽断言么?
客户端跟工具异常提示
Invalid regular expression: /(?<=name=).*?(?=&)/: Invalid group;at pages/index/index page lifeCycleMethod onLoad function
SyntaxError: Invalid regular expression: /(?<=name=).*?(?=&)/: Invalid group
如果使用正则表达式字面量来定义正则表达式【含有零宽断言】
(例如: reg=/(?<=name=).*?(?=&)/i )就会编译不通过
你好,我这边试了可以编译通过,但是会报错。后行断言是属于es7的提案,并不是所有浏览器支持,建议换种写法。
好的,我这边修改一下
好家伙, 23年了还在报错
好家伙2021年底了都还不支持,可以的
iphone 6s
All
Log
Info
Warn
Error
thirdScriptError
SyntaxError
at line:9730,column:137342,SyntaxError: Invalid regular expression: invalid group specifier name Stack: (native code)
at value (WAServiceMainContext.js:2:137342)
at (WAServiceMainContext.js:2:139380)
at (WAServiceMainContext.js:2:134947)
at (WAServiceMainContext.js:2:225277)
at (WAServiceMainContext.js:2:224245)
at forEach (native code)
at (WAServiceMainContext.js:2:224209)
at (WAServiceMainContext.js:2:225277)
at _ (WAServiceMainContext.js:2:77596)
global code
Invalid regular expression: invalid group specifier name,我报了这个错 ,ios就出现空白页了