Cron expressions schedule jobs: "*/15 9-17 * * 1-5" means every 15 minutes from 9am to 5pm on weekdays. Implement the five-field version.
cron_matches(expr, dt) returns True if the datetime dt matches. The fields are minute (0–59), hour (0–23), day of month (1–31), month (1–12) and day of week (0–6, with 0 = Sunday). Each field supports:
*: any value5, 1,15,309-17*/15 or 10-50/20 (every 20 within 10–50)Use the simple rule that all five fields must match. Raise ValueError for malformed expressions or out-of-range values. Then implement next_run(expr, after): the first matching minute strictly after after (with seconds and microseconds zeroed), searching at most one year ahead and returning None if nothing matches.