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