0

I'd like to create a regular expression, which matches left parenthesis. However, when I run:

new RegExp("\(")

in Node's repl, I get:

SyntaxError: Invalid regular expression: /(/: Unterminated group

Why is the backslash not escaping the left parenthesis?

Alexander Popov
  • 23,073
  • 19
  • 91
  • 130

0 Answers0