Is the condition on presence of '$' even needed? If there is no '$' the VARIABLE_RE will just not match anything.