def iter_parse(term, text):
    """
    Generator yields (text, capability) for characters of ``text``.

    value for ``capability`` may be ``None``, where ``text`` is
    :class:`str` of length 1.  Otherwise, ``text`` is a full
    matching sequence of given capability.
    """
    for match in term._caps_compiled_any.finditer(text):
        name = match.lastgroup
        value = match.group(name)
        if name == 'MISMATCH':
            yield value, None
        else:
            yield value, term.caps[name]
