regex2 = re.compile('(?i)%s' % '|'.join(booleans))
matched_data = list()
for d in data():
    if regex1.search(d) or regex2.match(d):
        matched_data.append(d)
What is the fastest way in Python to find if a string matches any terms in a list of words, phrases, boolean ANDs?