eshell-variable-name-regexp

eshell-variable-name-regexp is a variable defined in `esh-var.el'.
Its value is
"[A-Za-z0-9_-]+"


Documentation:
A regexp identifying what constitutes a variable name reference.
Note that this only applies for '$NAME'. If the syntax '$' is
used, then NAME can contain any character, including angle brackets,
if they are quoted with a backslash.

You can customize this variable.