string operations (ctrl characters)

Hans Nowak hnowak at cuci.nl
Thu Aug 16 09:30:57 EDT 2001


>===== Original Message From "Richard Brodie" <R.Brodie at rl.ac.uk> =====
>"Hans Nowak" <hnowak at cuci.nl> wrote in message
>news:mailman.997950925.22550.python-list at python.org...
>
>> You don't *need* regexen for this, though. One approach could be, scanning 
the
>> string for "acceptable" characters, and replacing anything else with some
>> default character, or removing it.
>
>That would not be best in this case, as he is seeing ANSI escape sequences.
>You often see things like <ESC>[23m ; there is a general syntax for them so
>a good emulator should be able to parse and ignore unrecognised codes.
>Unfortunately, there is no obvious "end escape sequence" delimiter, so its
>not entirely trivial.

Oh! I am using a web-based mail reader right now, and could not see some of 
the sequences he quoted, thus not realizing it was ANSI. (Some module that 
parses and shows text with ANSI-codes is on my to-do list, but I have nothing 
practical or working yet... <frown>)

--Hans Nowak





More information about the Python-list mailing list