import re rx = re.compile(r"\s*(?:\b(?:and|or)\b|[,.])\s*") strings = ["make the cake, walk the dog, and pick-up poo.", "flour, egg-whites and sand."] for s in strings: print( list(filter(None, rx.split(s))) )