From e6bc6d903aa9610aa5c46bcc45232f477dbe83b3 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Mon, 6 Sep 2021 23:55:07 +0300 Subject: [PATCH] fix match --- image_classifier/image_classifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image_classifier/image_classifier.py b/image_classifier/image_classifier.py index af38c59..4202837 100755 --- a/image_classifier/image_classifier.py +++ b/image_classifier/image_classifier.py @@ -95,7 +95,7 @@ class image_classifier: self._log.debug(f"New path: {new_path}") os.makedirs(os.path.dirname(new_path), exist_ok=True) if not new_path: - match = re.search(r'(?P2[0-9]{3})[\-/\._]?(?P[0-9]{1,2})[\-/\._]?(?P[0-9]{1,2})') + match = re.search(r'(?P2[0-9]{3})[\-/\._]?(?P[0-9]{1,2})[\-/\._]?(?P[0-9]{1,2})', filename) if match: new_path = os.path.join(dirname, match.group('year'), match.group('month'), match.group('day'), filename) if new_path: