1 2 3 4 5 6
def urlSolver(url): for (regex, handler) in URLSOLVERS: if regex.match(url): return handler(url) URLRX.sub(urlSolver, tweet)