def _rfind(expr, sub, start=0, end=None):
    """
    Return highest indexes in each strings in the sequence or scalar
    where the substring is fully contained between [start:end]. Return -1 on failure.
    Equivalent to standard str.rfind().

    :param expr:
    :param sub:
    :param start:
    :param end:
    :return: sequence or scalar
    """

    return _string_op(expr, RFind, output_type=types.int64,
                      _sub=sub, _start=start, _end=end)