How to avoid closing parenthesis character inside character class? According to the manual, to match the literal] it should be placed first on the list, but I need to match the complement of the class consisting of a square bracket.
Most metacharacters lose their special meaning within parenthesized expressions. To include a literal] put it first on the list. Similarly, to include the literal ^ place it anywhere, but first. Finally, to include a literal, put it last.
source
share