From bfff79c9291d3a2a589b51ead45cfe5c2b8f2d6c Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Sun, 23 Feb 2025 21:06:12 -0500 Subject: [PATCH] Regex readability improvements --- lib/xmet/igra.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/xmet/igra.py b/lib/xmet/igra.py index bdb5dc4..abaaecc 100644 --- a/lib/xmet/igra.py +++ b/lib/xmet/igra.py @@ -17,25 +17,25 @@ RE_HEADER = re.compile(r''' [ ] (?P[0-9\ ]{4}) [ ] (?P.{8}) [ ] (?P.{8}) - [ ] (?P[0-9 ]{7}) - [ ] (?P[0-9 ]{8}) + [ ] (?P[0-9\- ]{7}) + [ ] (?P[0-9\- ]{8}) $ ''', re.X) RE_SAMPLE = re.compile(r''' ^ (?P\d) (?P\d) - [ ] (?P[0-9 \-]{5}) - (?P[0-9 \-]{7}) + [ ] (?P[0-9\- ]{5}) + (?P[0-9\- ]{7}) (?P[AB ]) - (?P[0-9 \-]{5}) + (?P[0-9\- ]{5}) (?P[AB ]) - (?P[0-9 \-]{5}) + (?P[0-9\- ]{5}) (?P[AB ]) - (?P[0-9 \-]{5}) - [ ] (?P[0-9 \-]{5}) - [ ] (?P[0-9 \-]{5}) - [ ] (?P[0-9 \-]{5}) + (?P[0-9\- ]{5}) + [ ] (?P[0-9\- ]{5}) + [ ] (?P[0-9\- ]{5}) + [ ] (?P[0-9\- ]{5}) ''', re.X) def etime_to_seconds(etime: str) -> int: