my @aap = qw( 0aap 0noot 1mies 2mies 0aap 0noot 1mies 6mies ); foreach (@aap) { if (my $test = ( /^1(.*)/ .. /^0(.*)/ )) { print "$test: $1\n"; } }