import re with open("wiki.txt", "r") as f: onomatopees = re.findall(r"''([\w\s]+)''", f.read(), flags=re.M) onomatopees = print(" ".join(onomatopees))