From 2606b083932bd9e28d325f462703b0d59993c9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9?= <50486086+DarkCat09@users.noreply.github.com> Date: Tue, 6 Apr 2021 11:07:48 +0400 Subject: [PATCH] RegEx update --- bookrename.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookrename.py b/bookrename.py index df04cab..04d9b3b 100644 --- a/bookrename.py +++ b/bookrename.py @@ -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]*|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):