[Solved] SyntaxError: Invalid regular expression: invalid group specifier name

This is because Safari browser does not support regular expression zero assertion in two// formats:<= , ?<!

Solution:

Use constructor instead of// format



let reg = /ab?<=cd/
Change to
let reg = new RegExp('ab(?<=cd)')

Read More: