print map {"$_\n"} ($str=~/(\w+=)\&/g); #Thanks nferraz