kj wrote: > Sorry, I should have googled this first. I just found splitlines()... > > Still, for my own edification, is there a way to achieve the same > effect using re.split?
re.split(os.linesep, <string>) works the same as <string>.splitlines() Neither retain the EOL for each line, though. The only way I'm aware of is to re-add it: [s+os.linesep for s in re.split(os.linesep, <string>)] Was that what you were after? -- http://mail.python.org/mailman/listinfo/python-list