Skip to content

implement: src/regex -- regex crate, parsing box scores and play descriptions #9

@BryanChasko

Description

@BryanChasko

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions