From 7a5ef418a6cf7b9ad97cd715df1eb9bcb316f9fb 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:21:57 +0400 Subject: [PATCH] RegEx update --- bookrename.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookrename.py b/bookrename.py index 04d9b3b..997aef8 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]*|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):