in reply to Re: Find duplicate digits
in thread Find duplicate digits

Thanks, inman!

Yes, I would like 1010 to be counted.

I'm finding it hard to understand your grep. Where is the list that it's supposed to work on?

Replies are listed 'Best First'.
Re^3: Find duplicate digits
by holli (Abbot) on Feb 15, 2006 at 17:29 UTC
    The code is equivalent to
    while (<DATA>) { my $a = join('', sort split //, $_); my @a = $a =~ /((\d)\2+)/g; print "$_" if grep {length $_ == 2} @a; }


    holli, /regexed monk/
      Thanks, holli! That really helpful :)