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

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