'Works in Chrome, but breaks in Safari: Invalid regular expression: invalid group specifier name /(?<=\/)([^#]+)(?=#*)/

In my Javascript code, this regex /(?<=\/)([^#]+)(?=#*)/ works fine in Chrome, but in safari, I get:

Invalid regular expression: invalid group specifier name

Any ideas?



Solution 1:[1]

Just wanted to put this out there for anyone who stumbles across this issue and can't find anything...

I had the same issue, and it turned out to be a RegEx expression in one of my dependencies, namely Discord.js .

Luckily I no longer needed that package but if you do, consider putting an issue out there or something (maybe you shouldn't even be running discord.js in your frontend react app).

Hope this helps! :)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zac Yungblut