if you want to remove the
\r\n bit, you can pass the string through this function (written by sarnold):
""" Removes all escape sequences from the input string """
delete = ""
delete += chr(i)
i += 1
t = string.translate(None, delete)
Careful though, this will lump together the text in front and behind the escape sequences. So, using Martijn's filtered string
'ls\r\nexamplefile.zip\r\n', you will get
lsexamplefile.zip. Note the
ls in front of the desired filename.
I would use the stripEscape function first to remove the escape sequences, then pass the output to Martijn's regular expression, which would avoid concatenating the unwanted bit.