replace edx with variable substitution