Franz Steinhaeusler wrote: > > Thank you all for the replies. > But I still don't have a solution. > > Of course with more lines it is possible, > but it would be fine to have a "oneliner".
re.sub(r"\s+[\n\r]+", lambda x: x.expand("\g<0>"). \
lstrip(" \t\f\v"),text).rstrip()
...where "text" is the unsplit block of text with mysterious line-endings.
But I think your code is a lot easier to read. :)
--
http://mail.python.org/mailman/listinfo/python-list
