multipe instance scenario in perl

letz say that my file has 7 records with only one field. So my file has:

11111111
000000000000000
1111
aaaabbbccc
1111111222000000
aaaaaaaa
zz

All i need is:

  1. when the field has a repetition of the same instance(a-z or 0-9), i would consideer it to be invalid. eg.(11111111,000000000000000,1111,aaaaaaaa,zz are all invalid)

2.If there is a repetition of 2 or more instances,it is valid. (eg. 1111111222000000,aaaabbbccc is valid)

  1. Please note that the length of each field may vary.

So, i am expecting the output:
aaaabbbccc
1111111222000000

I am not sure if the title of the thread suits the matter. Anyway, whoever crosses this thread i would appreciate your input. Thanks in advance!

What have you tried so far?

^[0]+$ ---------> This will match all zeros. how do i match alpha and numeric in one expression

I don't think you'll be able to solve it easily just with a regex. I would split the line into characters, add them to a hash, and then check the number of members of the hash to make sure there are more than 1.

What about single characters... are they considered valid or invalid? e.g. ab, and aaab?

Maybe...

$ perl -n -e 'chomp;print "$_\n" if $_ =~ ("[^".substr($_,1,1)."]")' file1
aaaabbbccc
1111111222000000