Altered regular expression for optional whitespace

Alex had fixed the grammar to allow for a comment at the end of the
string with no trailing newline; this is a more efficient fix,
incorporating the change directly into the regular expression.