my $out=''; while ($str=~/(\w+=)\&/g){$out.=sprintf "%s\n",$1}; print $out;