jezyki-formalne/TaskB01/task1.py
2024-11-25 12:14:04 +01:00

10 lines
264 B
Python

import regex as re
with open('shakespeare.in', encoding='utf8') as file:
lines = file.readlines()
pattern = re.compile(r'Hamlet')
for line in lines:
line = line.strip()
x = re.search(pattern, line)
if x:
print(line)