my %hash; my @regexs = (Ausdruck1, Ausdruck2, Ausdruck3); open my $fh,'<',$filename or die $!; while(my $line = <$fh>){ my ($regex) = grep{$line =~ /$_/}@regexs; $hash{$regex} = $line unless exists $hash{$regex}; } close $fh;