Python Replace String Between Two Strings Are Anagrams