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

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!mcsun!sun4nl!ruuinf!piet
  3. From: piet@cs.ruu.nl (Piet van Oostrum)
  4. Subject: Re: programming challenge
  5. Sender: network-news@cs.ruu.nl
  6. Message-ID: <1992Dec14.114044.22303@cs.ruu.nl>
  7. In-Reply-To: Mike Stramba <stramba@zooid.guild.org>
  8. Date: Mon, 14 Dec 1992 11:40:44 GMT
  9. Reply-To: piet@cs.ruu.nl (Piet van Oostrum)
  10. References: <1992Dec12.100131.11703@zooid.guild.org>
  11. Organization: Dept of Computer Science, Utrecht University, The Netherlands
  12. Lines: 25
  13.  
  14. >>>>> Mike Stramba <stramba@zooid.guild.org> (MS) writes:
  15.  
  16. MS>  and I want to kill the duplicated letters and end up with:
  17.  
  18. I thought that 
  19.  
  20. s/(.)\1+/\1/g
  21.  
  22. would be a natural solution but perl complains
  23. /(.)\1+/: regexp *+ operand could be empty
  24.  
  25. whereas in this case it cannot be empty. It looks like \<digit> refs should
  26. inheruit attributes (e.g. HASWIDTH) from the referenced part.
  27. By the way the following:
  28.  
  29. s/(.)\1{2,}/\1/g;
  30.  
  31. gives an interesting error message:
  32.  
  33. /(.)\1{2,}/: internal regexp foulup
  34. -- 
  35. Piet* van Oostrum, Dept of Computer Science, Utrecht University,
  36. Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
  37. Telephone: +31 30 531806   Uucp:   uunet!mcsun!ruuinf!piet
  38. Telefax:   +31 30 513791   Internet:  piet@cs.ruu.nl   (*`Pete')
  39.