[Israel.pm] another regexp Q

Erez Schatz moonbuzz at gmail.com
Thu Oct 18 06:04:29 PDT 2007


VladimirB at ladpc.co.il wrote:

> Well, it tested by me and work properly with perl, v5.8.7 built for MSWin32-x86-multi-thread
> $a="ssadfaaadkjfhhh";
> print "$a\n";
> $a=~s /(.)\1+/$1/g;
> print $a;
> 
That works, but isn't answering what the original post asked for.


> -----Original Message-----
> From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf Of Ernst, Yehuda
> Sent: Wednesday, October 17, 2007 9:04 AM
> To: perl at perl.org.il
> Subject: [Israel.pm] another regexp Q
> 
> Hello!
> 
> I have an  array like this:
> 
> "aaadkjfh"
> "abcde"
> "dskkk"
> 
> i want to take out the elements that have 3 same letters together.
> 
> so i will be left with "abcde"

-- 
Erez

Software speaks with tongues of man; I debug, therefore I code.



More information about the Perl mailing list