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
  • 20,305
  • 19
  • 81
  • 119

0 Answers0