def fun1():
    print('fun1')

def fun2():
    print('fun2')

def fun3():
    print('fun3')
regex_handlers = [('regex1', fun1), ('regex2', fun2), ('regex3', fun3)]

def example(string):
    for regex, fun in regex_handlers:
        if re.match(regex, string):
            fun()
break
example('regex2')
How to concisely cascade through multiple regex statements in Python