$string =~ m/$start(.*?)$end/s $result = $1;