So verwenden Sie Re.Sub

new_string = re.sub(r"xxx|yyy", "abc", a_string)
Unusual Unicorn