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
topic: regex
the
regexcrate compiles patterns at startup for zero per-call overhead.concepts to demonstrate
Regex::new(), compile-once patternRegex::is_match(),captures(),find_iter()lazy_static!orOnceLockfor compile-once regexpatriots 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.rsreference
python mirror:
python_regex/directory