def rsplit(self, by, maxsplit=-1):
        res = []
        end = len(self)
        bylen = len(by)
        if bylen == 0:
            raise ValueError("empty separator")

        while maxsplit != 0:
            next = self._clean_string.rfind(by, 0, end)
            if next < 0:
                break
            # Get character codes after the index as well.
            res.append(self[next+bylen:end])
            end = next
            maxsplit -= 1   # NB. if it's already < 0, it stays < 0

        res.append(self[:end])
        res.reverse()
        return res
Stolen from PyPy's pure Python string implementation, tweaked for
dataset/ETHPy150Open evennia/evennia/evennia/utils/ansi.py/ANSIString.rsplit