def replace(self, txt):
    m = self.regex.search(txt)
    if m:
        found = m.string[m.start():m.end()]
        txt2 = txt.replace(found, self.to_)
        return txt2
    else:
        return txt
def replace(self, txt):
    m = self.regex.search(txt)
    if m:
        found = m.string[m.start():m.end()]
        txt2 = txt.replace(found, self.to_)
        return txt2
    else:
        return txt