import re


def _emulate_python_fullmatch(regex, string, flags=0):
    """Backport Python 3.4's regular expression "fullmatch()" to Python 2 by emulating python-3.4 re.fullmatch().

    If the whole string matches the regular expression pattern, return a corresponding match object.
     Return None if the string does not match the pattern; note that this is different from a zero-length match.

    :param str regex: A regex string.
    :param str string: The string that you want to apply regex match to.
    :param str|int flags: The expression's behaviour can be modified by specifying a flags value. Values can be any of
     the variables listed in https://docs.python.org/3/library/re.html

    :return SRE_Match/None: return a corresponding match object, or None if the string does not match the pattern.
    """
    return re.match("(?:" + regex + r")\Z", string, flags=flags)