Expected ')' in regular expression (JavaScript)

You attempted to create a regular expression capture, assertion, or group, but did not include the closing parenthesis. Parentheses have several purposes in regular expressions. Primarily, they are used to capture sub-expressions, to specify assertions, or to group patterns together so that the items can be treated as a single unit by *, +, ?, and so on.

To correct this error

  • Add the rightmost closing parentheses.


    If you want to match a single parenthesis, escape it with a backslash - \( - so that it is not interpreted as a special character by JavaScript.

See Also

Regular Expression Object
Regular Expression Syntax (JavaScript)