home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!usc!elroy.jpl.nasa.gov!ames!sun-barr!sh.wide!wnoc-tyo-news!sranha!sranhd!sran230!utashiro
- From: utashiro@sran230.sra.co.jp (Kazumasa Utashiro)
- Subject: Re: programming challenge
- References: <1992Dec14.185822.7058@wdl.loral.com>> <1992Dec15.070653.7276@zooid.guild.org> <mcook.724441713@fendahl.dev.cdx.mot.com>
- Organization: Software Research Associates, Inc., Japan
- Date: Wed, 16 Dec 1992 01:43:47 GMT
- Message-ID: <BzBwt0.9Mp@sran230.sra.co.jp>
- Lines: 14
-
- In article <mcook.724441713@fendahl.dev.cdx.mot.com>
- mcook@fendahl.dev.cdx.mot.com (Michael Cook) writes:
- >> >What I was puzzling over tonight was whether there was a single line 's/'
- >> >command syntax to delete all '_' characters but not '$_'.
- >>
- >> s/\b_//g;
-
- ??? This converts '$_' to '$' and 'a_' remains 'a_'.
-
- How about
-
- s/(^|[^\$])_+/$1/g;
-
- --utashiro
-