The thought behind this one is that the original regexp uses a greedy character class that accepts a string of characters composed of either `$` or `\w` (expands to `[A-Za-z0-9_]`) one or many times. This allows for some interesting variable names to be used: `$, $$, a$$, cat$, j0$e, etc.`. Since I believe the intended format is for a word (`\w`) optionally preceded by a `$` symbol, the current match is too relaxed and might allow for unintended consequences. The new one prevents the previous examples from being used.

Thinking about this now, if this is the case, I would assume these examples should be added to the tests.

I tried to research previous commits to see if there was some other reason for allowing this but the oldest commit already was in this form.