Python Find Substring Between Two Strings Oscillating