def METHOD_NAME(self, pattern, string):
    """Match regular expression (cached).
    Same as :func:`re.match`, except the regex is compiled and cached,
    then reused on subsequent matches with the same pattern.
    """
    try:
        compiled = self._compiled[pattern]
    except KeyError:
        compiled = self._compiled[pattern] = re.compile(pattern, re.U)
    return compiled.match(string)