pub fn count_capturing_groups(pattern: &str) -> usizeExpand description
Count capturing groups in a regex pattern string (for validating with_pattern / custom types).
Handles (?P<name>...) named captures; other (?...) extensions are treated as non-capturing
at the opening parenthesis (same rule of thumb as skipping (?:...), (?=...), etc.).