pub fn count_regex_matches(pattern: &str, input: &str) -> Option<usize>
Counts matches for a valid pattern.