I am trying to check compatibility for negative lookbehind assertions.
What I naturally would try is this:
try {
/((?<!test)$)/.test('test');
// if it doesn't throw an error it is supported
}
catch (e) {
// if it does throw an error it is not supported
}
But for some reason it crashes and doesn't catch the SyntaxError: invalid regexp group
Is there a way to catch this error?
Do you have any recommendations of how to check compatibility for this?
Thanks!