topic: regex
the regex crate compiles patterns at startup for zero per-call overhead.
concepts to demonstrate
Regex::new(), compile-once pattern
Regex::is_match(), captures(), find_iter()
- named capture groups
lazy_static! or OnceLock for compile-once regex
patriots theme
parse a play-by-play text file with patterns like:
"Brady pass complete to Branch for 23 yards"
extract: passer, target, yards, play type. build a box score from parsed plays.
file
src/regex/play_parser.rs
reference
python mirror: python_regex/ directory