import re def find_pies_lines(file_path): with open(file_path, 'r',encoding = 'utf-8') as file: for line in file: line = line.strip() if re.search(r'\bpies\b', line, flags=re.IGNORECASE): print(f"{line}") file_path = './simple.in' find_pies_lines(file_path)