Python Extract Substring Between Two Strings Oscillating