Created
April 6, 2019 07:54
-
-
Save alvinncx/5469241599e37cf2dbd3a1b3eab4e421 to your computer and use it in GitHub Desktop.
Username and email regex
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
@mail_regex ~r/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/ | |
@username_regex ~r/^(?=.{8,20}$)(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._]+(?<![_.])$/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment