jfz-2023-s474155/TaskD02/run.py
2023-11-27 13:18:58 +01:00

20 lines
394 B
Python

import sys
import re
inFile = sys.argv[1]
outFile = sys.argv[2]
with open(inFile, "r", encoding="utf-8") as sampleCheck, open(outFile, 'w', encoding='utf-8') as outputFile:
pattern = re.compile(r'(\bp\w*ies\b)', re.IGNORECASE)
for line in sampleCheck:
match = re.search(pattern, line)
if match:
outputFile.write(line)
print(line, end='')