Test, validate and match regular expressions
This PCRE regex matches C++ switch statements, capturing the switch condition, each case label's value and body block, and an optional default block. It uses recursive subpatterns to handle nested parentheses and braces, and correctly skips string/char literals containing escaped quotes. Useful for static code analysis, source parsing, refactoring tools, and extracting control-flow structures from C++ codebases.