import re


def fullmatch(regex, string, flags=0):
    """Emulate python-3.4 re.fullmatch()."""
    matched = re.match(regex, string, flags=flags)
    if matched and matched.span()[1] == len(string):
        return matched
    return None