print grep { /(\d).*\1/ && ! /(\d).*\1.*\1/ } map {sprintf "%04d",$_} +(0..9999)
Tried to do it in one regex but I couldn't find out how to negate the match \1, [^\1] obviously doesnt work and all negative look aheads get confused by the end of string...
Cheers Rolf
UPDATE: sorry nothing new :( ...Re: Find duplicate digits
In reply to Re: Find duplicate digits
by LanX
in thread Find duplicate digits
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |