[vworld-tech] Telnet negotiation

Kevin Reid kpreid at attglobal.net
Sun Jan 25 19:33:46 PST 2004

Brian Hook <hook_l at pyrogon.com> wrote:

> Unfortunately, it doesn't look like ANSI esc sequences are well-structured
> such that I don't have to write a full freakin' parser for it -- is there
> a simple bit of logic I can use to "skip ESC sequence", or will I have to
> actually parse it?  Or should I just check for the arrow keys and leave it
> at that?

(Perl-style regular expressions)

/\c[\[.*?[A-Za-z]/ would catch all the sequences I've seen (in my
limited experience).

For more completeness, this is what I got from skimming a "VT240 Series
Programmer Pocket Guide".

    ( \x9B | \c[\[ ) .*? [A-Za-z~@] 
        P .*? \c[\/
      | [?\ ]? [A-Za-z|}]
      | [()*+] [\x20-\x2F]{0,2} [\x30-\x7E]

I have no idea what subset or superset of these sequences are "ANSI".

Kevin Reid

More information about the vworld-tech mailing list