home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7449 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.0 KB  |  29 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!munnari.oz.au!yarrina.connect.com.au!melba.bby.com.au!gnb
  3. From: gnb@baby.bby.com.au (Gregory N. Bond)
  4. Subject: Re: programming challenge
  5. In-Reply-To: Mike Stramba's message of Sat, 12 Dec 1992 10:01:31 GMT
  6. Message-ID: <1992Dec16.043128.7616@bby.com.au>
  7. Sender: usenet@bby.com.au (news READER id)
  8. Nntp-Posting-Host: baby
  9. Organization: Burdett, Buckeridge & Young, Melbourne, Australia
  10. References: <1992Dec12.100131.11703@zooid.guild.org>
  11. Date: Wed, 16 Dec 1992 04:31:28 GMT
  12. Lines: 15
  13.  
  14. If you are editing man pages, they probably contain things like
  15. E^HE to make things bold, and _^HE (or E^H_, depending on your
  16. nroff) to underline them.  Rather than stripping the ^Hs then
  17. compressing the repeats, what about doing both at once:
  18.  
  19.     perl -pi.bak -e 's/(.)\cH$1/$1/g;s/_\cH(.)/$1/g;' {files}
  20.  
  21. (NB: \b is word boundry in regexps! Use ^H instead!)
  22.  
  23. Greg.
  24. --
  25. Gregory Bond <gnb@bby.com.au> Burdett Buckeridge & Young Ltd Melbourne Australia
  26.       If I hear "Jingle Bell Rock" one more time, I will _scream_!
  27.  
  28.  
  29.