Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Pattern substitution

Reply
Thread Tools

Pattern substitution

 
 
rschroe@gmail.com
Guest
Posts: n/a
 
      02-03-2006
Can anyone explain this command to me?


A file is passed to this command and the output piped to a file.


perl -pe 's/\e&k[0-9]S\e&l[0-9]H\eE//'


What it seems to do is cut everything between the first / and the
second /, but can't quite get the sense of what is being cut.


Thanks for your help


RCS

 
Reply With Quote
 
 
 
 
Brian Helterline
Guest
Posts: n/a
 
      02-03-2006
Jim Gibson wrote:
> \e is the metasymbol for the escape character, so it looks like it is
> removing escape sequences such as escape-&-k-0-S and escape-&-l-9-H. I
> don't know what the sequences \e&k0S through \e&k9S or \e&l0H through
> \e&l9H do, but \eE is the ANSI escape sequence for "Next Line". ANSI


They are PCL escape sequences used to control printer output.
Most likely the file was created by a "Print to File" command
within an application.

--
brian
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gsub pattern substitution and ${...} Sarah Allen Ruby 7 05-11-2009 01:00 PM
Pattern based substitution Daniel Mircea Ruby 0 10-16-2006 05:17 PM
Regular Expression for pattern substitution Vibha Tripathi Python 3 07-01-2005 06:31 PM
utf8 issue with substitution pattern Vorxion Perl Misc 0 04-19-2005 01:30 AM
speed issues with pattern matching and substitution Arturi Perl Misc 8 04-05-2005 10:19 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57