Created
July 8, 2015 15:09
-
-
Save gswalden/27ac96e497c3aa1f3230 to your computer and use it in GitHub Desktop.
Regex for valid Slack usernames
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Slack's interface: | |
// Usernames may only contain lowercase letters, numbers, periods, | |
// dashes and underscores and must start with a letter or number. | |
/^[a-z0-9][a-z0-9._-]*$/.test(username); |
I've recently seen Slack usernames with spaces and uppercase letters so this may be outdated.
you are right, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for this!