Created
March 5, 2024 20:38
-
-
Save waquwex/6bbb919db24aebeff5afa9d03d6a9552 to your computer and use it in GitHub Desktop.
Reasonable Regex patterns, Email, Username, Password
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
| const EMAIL_REGEX_PATTERN = /^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/; | |
| const USERNAME_REGEX_PATTERN = /^([A-Za-z\d._-]{5,})$/; // English letters + Numbers + . _ - | |
| const PASSWORD_REGEX_PATTERN = /^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[._*-])[A-Za-z\d._*-]{8,}$/; | |
| // Should contain at least one uppercase english letter, atl east one lowercase english letter, | |
| // at least one number, at least one of . _ * - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment