in reply to Regex question: How do I remove an escape code from text?

\x05 should work:
$ echo 'text^E^E^E^E' |perl -ne 's/\x05//g;print;'|od -c 0000000 t e x t \n 0000005

CU
Robartes-

Replies are listed 'Best First'.
Re: Re: Regex question: How do I remove an escape code from text?
by Declarent (Sexton) on Mar 20, 2003 at 17:25 UTC

    Unfortunately this doesn't work. While I know that escape codes don't care about case, this shows up as ^e, rather than ^E and it resists all versions of 05 that I can throw at it. I'm thinking now that maybe it's something else and not that escape code. Is there a way to match it outside of hex? Also, it doesn't show up as regular text and does not match to \^e.

      You should run a sample of the input through od and see whats really there.

      I would recommend the -c and or -a switches to get 005 or enq respectively if its a control-e