RegEx update

This commit is contained in:
Андрей 2021-04-06 11:21:57 +04:00 committed by GitHub
parent e7b5e249ba
commit 7a5ef418a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@ template = '{author} -- {title} -- {year}.{ext}'
curdir = os.getcwd()
# Компилируем регулярку
# https://regexr.com/5q42v
bookregex = re.compile(r'[\[\(]*([А-Яа-я\w\s]+?)[\]\)]*[:\.\-\s]*([А-Яа-я\w\d\s]+?)[:\.\-\s]*(\d+)(?:\.(pdf|doc[x]*|odf|epub|fb2|txt))')
bookregex = re.compile(r'[\[\(]*([А-Яа-я\w\s]+?)[\]\)]*[:\.\,\-\s]*([А-Яа-я\w\d\s]+?)[:\.\,\-\s]*(\d+)(?:\.(pdf|doc[x]*|odf|epub|fb2|txt))')
# Получаем дерево каталогов и файлов в curdir
for rootdir, subdirs, files in os.walk(curdir):