(#17094) Escape variable name in parse_string

Without this, parse_string would break (usually with an infinite loop) if a variable name had characters that were significant in a regular expression.