import re


def _remove_phrasing(ipt_txt, phrase, replacement):
    """
    removes the given phrase and replaces it with the replacement
    :param ipt_txt: string to change
    :param phrase: unwatned phrase to be removed
    :param replacement: replacement phrase
    :return: string with the phrase replaced with replacement
    """
    a = re.search(
        phrase,
        ipt_txt)
    it =0
    while a and it<=50:
        ipt_txt = re.sub(a.group(), replacement,
                      ipt_txt)
        a = re.search(
            phrase,
            ipt_txt)
        it+=1
        if it>50:
            raise Exception('While Loop fail. ' + str(phrase))
    return ipt_txt