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

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!ftpbox!mothost!merlin.dev.cdx.mot.com!fendahl.dev.cdx.mot.com!mcook
  3. From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
  4. Subject: Re: programming challenge
  5. Message-ID: <mcook.724208660@fendahl.dev.cdx.mot.com>
  6. Sender: news@merlin.dev.cdx.mot.com (USENET News System)
  7. Nntp-Posting-Host: fendahl.dev.cdx.mot.com
  8. Organization: Motorola Codex, Canton, Massachusetts
  9. References: <1992Dec12.100131.11703@zooid.guild.org>
  10. Date: Sun, 13 Dec 1992 01:04:20 GMT
  11. Lines: 33
  12.  
  13. Mike Stramba <stramba@zooid.guild.org> writes:
  14.  
  15. >Ok, all you perl wizards out there.
  16.  
  17. >This out'a be a snap for ya.
  18.  
  19. > If I have the string :
  20.  
  21. >          Exxxxppppppprrrrrrreeeeesssssiiiiiiiiioooooonnnnnnnnnsssssssss
  22.  
  23. > and I want to kill the duplicated letters and end up with:
  24.  
  25. >          Expressions
  26.  
  27. You mean "Expresions", right?
  28.  
  29. > Lets' see some of your elegant solutions !
  30.  
  31. > Btw, this problem came up as a result of trying to edit a formatted man
  32. > page ... for guess what program ?  (starts with 'P ... ends with 'l')
  33.  
  34. > Why am I editing a man page? ... because my computer, an Atari doesn't know
  35. > about them.
  36.  
  37. > I'm interested in seeing solutions to the above, anyway.
  38.  
  39. >Mike
  40.  
  41. Okay--Here's a non-general solution:
  42.  
  43.   s/x+|p+|r+|e+|s+|i+|o+|n+/substr($&,0,1)/eg
  44.  
  45. Michael.
  46.