Last active
February 12, 2022 21:57
-
-
Save shettayyy/83625e7cf8e84cf03b4a78c2278d5e9a to your computer and use it in GitHub Desktop.
Username regex
This file contains hidden or 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
// Your field can only contain | |
// alphabets and numbers separated by period (.), hyphen (-), and underscore (_) and should begin with an alphabet | |
const usernameRegex = /^[a-z](?:[_.-]?[a-z0-9])*$/; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment