def match_first(string, *args):
    """
    matches against list of regexp and returns first match.
    """
    for patternlist in args:
        for pattern in patternlist:
            r = pattern.search(string)
            if r is not None:
                name = r.group(1)
                return name

    return string