Use an alternate regex delimiter as sed allows you to use any delimiter ( including control characters ):

sed "s~$var~replace~g" $file