The following javascript regular expression causes SyntaxError in safari: Invalid regular expression: invalid group specifier name"
/^(?!\s)[A-Za-z0-9\'\.\-\,\s]*(?<!\s)$/.test('ABCD@#');
Can someone help me rewrite the regex that will work in safari?
I found out that safari doesn't support lookbehind, but still can't rewrite the whole regex, which would be useful for safari.
Modify your schema to avoid negative reviews. Since you seem to want a non-whitespace character as the last character, just use a character class.
Side note: Your current pattern looks wrong for what you are trying to match.