modified replace-vars (a regex syntax error)