Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle more edge cases #3

Merged
merged 1 commit into from
May 10, 2018
Merged

Conversation

dguo
Copy link
Contributor

@dguo dguo commented Mar 2, 2018

Fixes #2 and #7.

@dguo dguo force-pushed the block-underscores branch from ab57246 to aec2ccb Compare March 3, 2018 00:51
@dguo dguo changed the title Disallow underscores Handle more edge cases Mar 3, 2018
@RedSparr0w
Copy link

Nice, could also simplify it more with:

/^([a-z\d]+-)*[a-z\d]+$/i

@dguo dguo force-pushed the block-underscores branch from aec2ccb to 20208be Compare May 9, 2018 17:38
1. Disallow underscores
2. Allow single character usernames
3. Allow multiple hyphens, as long as they aren't next to each other
@dguo dguo force-pushed the block-underscores branch from 20208be to ee23950 Compare May 9, 2018 17:44
@dguo
Copy link
Contributor Author

dguo commented May 9, 2018

Good points. I replaced the 0-9s with \d and added the case insensitive flag.

@tunnckoCore
Copy link
Member

Hey @dguo sorry for the delay, not pretty organized recent months! 😆

Thanks! 🚀

@tunnckoCore tunnckoCore merged commit 74ae57d into regexhq:master May 10, 2018
@tunnckoCore
Copy link
Member

I'll publish new release soon.

@dguo dguo deleted the block-underscores branch May 10, 2018 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants