def _rreplace(s, old, new, occurrence=1):
    """Simple function to replace the last 'occurrence' values of 'old'
    with 'new' in the string 's'

    Thanks to https://stackoverflow.com/questions/2556108/
                    rreplace-how-to-replace-the-last-occurrence-
                    of-an-expression-in-a-string
    """
    s = s.rsplit(old, occurrence)
    return new.join(s)