import re


def match_keyword(value, keywords):
    """Finds the closest match to a `value` given a list of `keywords`.

    >>> match_keyword('l', ['left', 'right', 'auto'])
    "left"

    >>> match_keyword('xxx', ['inherit', 'auto'])
    None
    """
    for word in keywords:
        if re.match('^'+value, word): return word
    for word in keywords:
        if re.match(value, word): return word