See the following code. It will match & followed by n number of
numbers/characters.

Code:
$val =~ s/&(.*) /{$1}/g;
print $val;