my $str = ; my @strs = $str =~ /START(.*?)END/g; print join "\n", @strs; __DATA__ somecharSTARTfvENDsomecharSTARTsvENDsomecharSTARTtvENDsomechar