From 5f44d874d60012dd68a2a1a0c161b8948f2475b9 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Wed, 1 Nov 2023 12:59:03 +0200 Subject: [PATCH] Fix regexp for date --- image_classifier/image_classifier.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/image_classifier/image_classifier.py b/image_classifier/image_classifier.py index 4b53509..46ce862 100755 --- a/image_classifier/image_classifier.py +++ b/image_classifier/image_classifier.py @@ -159,8 +159,7 @@ class image_classifier: if file_date is None: self._log.debug('Date not stored in EXIF metadata') match = re.search( - r'(?P20[0-9]{2})[\-/\._]?(?P[0-1]?[0-9])\ -[\-/\._]?(?P[0-3]?[0-9])', + r'(?P20[0-9]{2})[\-/\._]?(?P[0-1]?[0-9])[\-/\._]?(?P[0-3]?[0-9])[\-/\._]?(?P[0-2]?[0-9])?[\-/\._]?(?P[0-6]?[0-9])?[\-/\._]?(?P[0-6]?[0-9])?', filename ) if match: