my $string = "Rückantwort"; my @parts = split /\n\n/,$string; for my $part ( @parts ){ next unless $part =~ m!^\s*Volume!; print $part; }