def dostuff():
    stuff

def dootherstuff():
    otherstuff

def doevenmorestuff():
    evenmorestuff
actions = (regex1, dostuff), (regex2, dootherstuff), (regex3, doevenmorestuff)
for regex, action in actions:
    m = re.match(regex, line)
if m:
    pass
Python regex matching in conditionals