Created
March 6, 2017 21:35
-
-
Save alexsasharegan/6276c9cdc228bf5a718e27fe3b342029 to your computer and use it in GitHub Desktop.
Common RegExes for me
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
class MyRegEx { | |
static email(){ | |
return /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; | |
} | |
static ssn(){ | |
return /^(?!000|666|900|999)(\d{3})-?(?!00)(\d{2})-?(?!0000)(\d{4})$/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment