def _compare_match_length(item1, item2):
    """Compare two matches from the Pattern Matcher by the last matching index.

    :param item1: first matches item
    :param item2: second matches item
    :return: comparison result where -1 means item1 < item2, 1 means item1 >
    item2 and 0 means item1 == item2
    """
    if (item1[2] - item1[1]) < (item2[2] - item2[1]):
        return -1
    elif (item1[2] - item1[1]) > (item2[2] - item2[1]):
        return 1
    else:
        return 0