regex1 = re.compile('(?i)\\b(?:%s)\\b' % '|'.join(words_and_phrases))
regex2 = re.compile('(?i)%s' % '|'.join(booleans))
What is the fastest way in Python to find if a string matches any terms in a list of words, phrases, boolean ANDs?