n(matches):
        if not silent_fail:
            raise Exception(f&#34;No match info with index {matchidx}, length is {len(matches)}&#34;)
        return None
    return matches[matchidx]


# pylint: disable=R0912
def _get_span(succ, name, resultidx=0, matchidx=0, silent_fail=False):
    &#34;&#34;&#34;
    Helper method to return the span for the given result index and name, or None.

    Args:
        succ: success instance
        name: name of the match info, if None, uses the entire span of the resu