task2, added case with dot

This commit is contained in:
Robert 2024-11-25 12:44:15 +01:00
parent a7892ad185
commit b718541d69

View File

@ -2,7 +2,7 @@ import regex as re
with open('polish_wiki_excerpt.in', encoding='utf8') as file:
lines = file.readlines()
pattern = r'( |[Pp])ies(( \w+)|$)'
pattern = r'( |[Pp])ies(( \w+)|(\.$))'
for line in lines:
line = line.strip()
x = re.search(pattern, line)