Adjusted regexp to handle matches with hyphens and underscores at end.
Extra test check added.