Is there any equivalent to str.split in Python that also returns the delimiters?
str.split
I need to preserve the whitespace layout for my output after processing som
How about
import re splitter = re.compile(r'(\s+|\S+)') splitter.findall(s)