SyntaxError: invalid class set operation in regular expression

The JavaScript exception "invalid class set operation in regular expression" occurs when a double punctuator sequence appears in a v-mode character class but it is not recognized by the syntax.

Message

SyntaxError: Invalid regular expression: /[&&]/v: Invalid set operation in character class (V8-based)
SyntaxError: invalid class set operation in regular expression (Firefox)
SyntaxError: Invalid regular expression: invalid operation in class set (Safari)

Error type

SyntaxError

What went wrong?

There are three possible ways this could happen:

See also