Archived
1
0
Fork 0

improve regex match

This commit is contained in:
yzhh 2021-11-12 18:31:33 +08:00
parent 379f69281a
commit 5a23f61704

View file

@ -223,6 +223,8 @@ class WikiLib:
desc = '\n'.join(desc_list)
desc_end = re.findall(r'(.*?(?:!\s|\?\s|\.\s|||。)).*', desc, re.S | re.M)
if desc_end:
if re.findall(r'[({\[>\"\'《【‘“]', desc_end[0]):
desc_end = re.findall(r'(.*?[)}\]>\"\'》】’”].*?(?:!\s|\?\s|\.\s|||。)).*', desc, re.S | re.M)
desc = desc_end[0]
except Exception:
traceback.print_exc()