def METHOD_NAME(self, match):
    escapes, text = match.groups()
    half, is_escaped = divmod(len(escapes), 2)
    escapes = escapes[:half]
    text = text or ''
    if is_escaped:
        marker, value = text[:1], text[1:]
        text = self._escape_handlers[marker](value)
    return escapes + text