Skip to content

Instantly share code, notes, and snippets.

@alexsasharegan
Created March 6, 2017 21:35
Show Gist options
  • Save alexsasharegan/6276c9cdc228bf5a718e27fe3b342029 to your computer and use it in GitHub Desktop.
Save alexsasharegan/6276c9cdc228bf5a718e27fe3b342029 to your computer and use it in GitHub Desktop.
Common RegExes for me
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