import re


def get_single_value(data, regex):
    """ Return a single regex result. """

    p = re.compile(regex)
    result = p.findall(data)
    if len(result) > 0:
        return result[0]
    return None