**Restrict fielding-sequence regexes to fielders 1-9** #60

Closed
opened 2026-04-20 16:54:29 +02:00 by umpire274 · 0 comments
umpire274 commented 2026-04-20 16:54:29 +02:00 (Migrated from github.com)

Restrict fielding-sequence regexes to fielders 1-9

Both fielding-sequence token patterns use \d, so invalid inputs like 60 or 6-0 are lexed as valid FieldingSeq values even though fielder 0 is illegal. Those inputs bypass parse-time rejection and later fail in command building with a generic validation error (segment_index: 0) rather than a segment-specific parse error, which breaks the new diagnostic model. Tightening these regexes to [1-9] prevents malformed fielder numbers from entering the pipeline.

Useful? React with 👍 / 👎.

Originally posted by @chatgpt-codex-connector[bot] in https://github.com/umpire274/bs_scoring/pull/58#discussion_r3111521202

**Restrict fielding-sequence regexes to fielders 1-9** Both fielding-sequence token patterns use `\d`, so invalid inputs like `60` or `6-0` are lexed as valid `FieldingSeq` values even though fielder `0` is illegal. Those inputs bypass parse-time rejection and later fail in command building with a generic validation error (`segment_index: 0`) rather than a segment-specific parse error, which breaks the new diagnostic model. Tightening these regexes to `[1-9]` prevents malformed fielder numbers from entering the pipeline. Useful? React with 👍 / 👎. _Originally posted by @chatgpt-codex-connector[bot] in https://github.com/umpire274/bs_scoring/pull/58#discussion_r3111521202_
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
umpire274/bs_scoring#60
No description provided.