in reply to Find duplicate digits
The OP didn't make it clear whether a number such as 0101 that has two pairs should be counted. You can always test the number of members of the list returned by the grep.
giveswhile (<DATA>){ print "$_" if grep {length $_ == 2} join('', sort split //, $_) =~ + /((\d)\2+)/g; } __DATA__ 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 01511 451411
0011 0012 0013 0014 451411
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Find duplicate digits
by Anonymous Monk on Feb 15, 2006 at 15:52 UTC | |
by holli (Abbot) on Feb 15, 2006 at 17:29 UTC | |
by Anonymous Monk on Feb 16, 2006 at 04:25 UTC |