From 851d47d244fd95a116303514f9f4e335f08fb34d Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Fri, 5 Feb 2021 20:22:04 -0600 Subject: [PATCH] Fix bug in score regex It would allow matches like `[-10-00]` (a hyphen anywhere in the middle of a number) --- trash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trash.py b/trash.py index 1c67b5c6..538081e4 100644 --- a/trash.py +++ b/trash.py @@ -21,7 +21,7 @@ args = argparser.parse_args() Filter = Enum('FilterType', 'Preferred Required Ignored') header_regex = re.compile(r'^(#+)\s([\w\s\d]+)\s*$') -score_regex = re.compile(r'score.*?\[([-\d]+)\]', re.IGNORECASE) +score_regex = re.compile(r'score.*?\[(-?[\d]+)\]', re.IGNORECASE) # included_preferred_regex = re.compile(r'include preferred', re.IGNORECASE) # not_regex = re.compile(r'not', re.IGNORECASE) filter_regexes = (