The basic regular expressions [\(], [\)], [\{] and [\}] do not match the backslash, even though all of them should. The lexer internally recognizes and handles these "escaped" parentheses and braces as the opening and closing parentheses of capture groups or braces of quantifiers, even though there are no capture groups or quantifiers within character classes.
Noticed while writing test coverage for closely related #5244.