items = [' '.join(el[0] or el[1] for el in g) for k, g in groupby(re.
    findall("('.*?')|(\\S+)", text), lambda L: L[1] == 'and') if not k]
How to split a string by a string except when the string is in quotes in python?