Home > Mobile >  The console error SyntaxError: Invalid regular expression: Invalid group specifiers name
The console error SyntaxError: Invalid regular expression: Invalid group specifiers name

Time:11-18

After using uniapp packaging project android preview is normal, but apple console to quote the following error:



So search on the Internet and try once, found that is the problem that the regular expression,

emergence reason

After packaging of js does not support native double slash format of regular//

solution

//packaging cases complains
let regExp=/(? <=(? !//). *?//). *!/g;

//changed to the following format can
let regExp=new regExp (" (? <=(? !//). *?//). *!" "G");

  •  Tags:  
  • iOS
  • Related