foreach my $key ( keys %hash ) { if( $key =~ m/\d+_\d+/ ) { print "key = $key, value = $hash{$key}\n"; } }