Python Replace String Between Two Strings Oscillating Multifunction