Declarent has asked for the wisdom of the Perl Monks concerning the following question:
I'm recieving text input and I find that it has escape characters in it that I want to remove.
Under more and print, you obviously can't see these characters, but if you write out the contents of the variable to a file and vim it, you can see something like:
text^e^e^e^e
I'm using this to try and strip the characters:
$var=~s/someregex//g
Where someregex has been: \005,\cE,\ce,\x005,\x0x005
No luck. Anyone know what this mysterious escape character is and how I can get rid of it? Note that it only appears on the end of the string, and that the number of them is random.
Declarent
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex question: How do I remove an escape code from text?
by jsprat (Curate) on Mar 20, 2003 at 18:00 UTC | |
by Declarent (Sexton) on Mar 20, 2003 at 18:40 UTC | |
|
Re: Regex question: How do I remove an escape code from text?
by dga (Hermit) on Mar 20, 2003 at 17:29 UTC | |
|
Re: Regex question: How do I remove an escape code from text?
by robartes (Priest) on Mar 20, 2003 at 17:15 UTC | |
by Declarent (Sexton) on Mar 20, 2003 at 17:25 UTC | |
by dga (Hermit) on Mar 20, 2003 at 17:33 UTC |