The discussion revolves around the functionality of negative lookbehind expressions in Watched Words regex. tkrunning reports that the regex (?<!new\s)\bcar\b fails with an error in Safari, despite working in Chrome. Canapin confirms it works for them across browsers, but tkrunning notes the issue is browser-dependent, likely due to Safari 16.3 lacking support for negative lookbehind, which was introduced in Safari 16.4. tkrunning also mentions unrelated user preference saving issues.
It seems negative lookbehind expressions (which should be valid in both Ruby and JS flavors of regex, the latter as of ECMAScript 2018) don’t work in Watched Words.
Here’s an example:
(?<!new\s)\bcar\b should match instances of car that are not preceded by new.
E.g. it should match car in this sentence:
He drives a car
But not in this sentence:
He drives a new car
However, it returns the following error when adding under Watched Words:
Is this not supported on purpose or is it a bug? Or does it need to be written in a different way?
Interestingly, it seems to be browser-dependent. I get the error in Safari, but not in Chrome. When adding it in Chrome and viewing the list in Safari the error shows up there.