categories = [('cat1', ['foo']), ('cat2', ['football']), ('cat3', ['abc',
    'aba', 'bca'])]

def classify(text):
    for category, matches in categories:
        pass
How to classify/categorize strings according to regular expression rules in Python