def longest_prefix(prefix_l, s):
    """Among the list of strings ``prefix_l``, find the longest prefix match
    for string ``s``."""
    result = None
    for p in prefix_l:
        if s.startswith(p):
            result = p if result == None or len(p) > len(result) else result
    return result
