def replace_recursive(text, to_match, repl=''):
    """
    Works the same as str.replace, but recurses until no matches can be found.
    Thus, ``replace_recursive('hello_wooorld', 'oo', '')`` would replace
    ``wooorld`` with ``woorld`` on the first pass, and ``woorld`` with
    ``world`` on the second.

    Note that ``str.replace`` only performs one pass, so
    ``'wooorld'.replace('oo', 'o')`` would return ``woorld``.

    :param text: the text to operate on.
    :param to_match: the text to match.
    :param repl: what to replace any matches with.
    :return: text, guaranteed to not contain ANY instances of ``to_match``.
    """
    while to_match in text:
        text = text.replace(to_match, repl)
    return text