SED - Change - Change last instance in a line
sed
's/\(.*\)foo/\1bar/'