github-username-regex icon indicating copy to clipboard operation
github-username-regex copied to clipboard

Support for historical usernames with trailing hyphens.

Open En-En-Code opened this issue 2 years ago • 0 comments

By switching to a negated look-ahead assertion, the new RegExp can easily detect double hyphens while also allowing a single hyphen at the end of a username. We don't lose the following character checked against [a-z\d] from the positive look-ahead assertion as this is covered by the earlier instance of this in the expression.

Added new unit test cases and updated README.md.

Resolves #4.

En-En-Code avatar Jan 02 '23 16:01 En-En-Code