import re


def lex_1(src, clauses):
    """Scan one symbol from src and return a tuple of the symbol and remaining src"""
    for (regex, action) in clauses:
        matcher = re.match(regex, src)
        if matcher:
            if callable(action):
                action = action(matcher)
            return (action, src[matcher.end():])
    return None