I don't think we need the `$` in the regex here.  The grammar will take care of the fact that a unit can only appear at the end of the string.