How do I accomplish to split a string by X, only if X is followed by any of the values in a list?
Split below by , if next word is in list
first_string = "color=blue,size=xl" # Should be splitted
second_string = "color=white,pattern=dotted" # Should not be splitted
list = ['size', 'weather', 'mode'];