import re
with open('wordlist.txt', 'r') as searchfile:
    for line in searchfile:
        if re.search('\\sthere\\s', line, re.M | re.I):
            pass
How do I match a word in a text file using python?