home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!mcsun!sun4nl!ruuinf!piet
- From: piet@cs.ruu.nl (Piet van Oostrum)
- Subject: Re: programming challenge
- Sender: network-news@cs.ruu.nl
- Message-ID: <1992Dec14.114044.22303@cs.ruu.nl>
- In-Reply-To: Mike Stramba <stramba@zooid.guild.org>
- Date: Mon, 14 Dec 1992 11:40:44 GMT
- Reply-To: piet@cs.ruu.nl (Piet van Oostrum)
- References: <1992Dec12.100131.11703@zooid.guild.org>
- Organization: Dept of Computer Science, Utrecht University, The Netherlands
- Lines: 25
-
- >>>>> Mike Stramba <stramba@zooid.guild.org> (MS) writes:
-
- MS> and I want to kill the duplicated letters and end up with:
-
- I thought that
-
- s/(.)\1+/\1/g
-
- would be a natural solution but perl complains
- /(.)\1+/: regexp *+ operand could be empty
-
- whereas in this case it cannot be empty. It looks like \<digit> refs should
- inheruit attributes (e.g. HASWIDTH) from the referenced part.
- By the way the following:
-
- s/(.)\1{2,}/\1/g;
-
- gives an interesting error message:
-
- /(.)\1{2,}/: internal regexp foulup
- --
- Piet* van Oostrum, Dept of Computer Science, Utrecht University,
- Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
- Telephone: +31 30 531806 Uucp: uunet!mcsun!ruuinf!piet
- Telefax: +31 30 513791 Internet: piet@cs.ruu.nl (*`Pete')
-