The following regex is working just fine on Chrome, but it breaks in Safari with the following error: SyntaxError: Invalid regular expression: invalid group specifier name.
Regex: /^[a-zA-Z0-9.!#$%&'*+\-\/=?^_{|}~]+[@](?!-)[a-zA-Z0-9-]+(?<!-)[.][a-zA-Z]{2,}$/
I am new at Regex, so I have no idea why it seems to work on 1 browser but not the other, is there anyway I can fix this?
Example Data:
random#email@domain-good.com
random@domain-bad-.com
The 2 example should fail because it starts/ends with a -.