Uncaught Exception: SyntaxError: Invalid regular expression: \ at end of pattern