djfz-24_25/TaskB02/task2.py

10 lines
279 B
Python

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