Escape the replacement string to avoid problem while replacing strings
with $ in them (e.g. temp variables)