Fix regexp for date

This commit is contained in:
Antonio J. Delgado 2023-11-01 12:59:03 +02:00
parent 5cd5c1791b
commit 5f44d874d6

View file

@ -159,8 +159,7 @@ class image_classifier:
if file_date is None: if file_date is None:
self._log.debug('Date not stored in EXIF metadata') self._log.debug('Date not stored in EXIF metadata')
match = re.search( match = re.search(
r'(?P<year>20[0-9]{2})[\-/\._]?(?P<month>[0-1]?[0-9])\ r'(?P<year>20[0-9]{2})[\-/\._]?(?P<month>[0-1]?[0-9])[\-/\._]?(?P<day>[0-3]?[0-9])[\-/\._]?(?P<hour>[0-2]?[0-9])?[\-/\._]?(?P<minute>[0-6]?[0-9])?[\-/\._]?(?P<second>[0-6]?[0-9])?',
[\-/\._]?(?P<day>[0-3]?[0-9])',
filename filename
) )
if match: if match: