>perl -wMstrict -le "my @strings = qw(0110 1 11 01110 001 100 1111 01001110); my @three_or_more = grep { m{ 1{3} }xms } @strings; printf qq{'$_' } for @three_or_more; " '01110' '1111' '01001110'