Skip to content

Instantly share code, notes, and snippets.

@cleonps
Last active June 16, 2020 17:57
Show Gist options
  • Save cleonps/1507acead5c372159ac6e24239023709 to your computer and use it in GitHub Desktop.
Save cleonps/1507acead5c372159ac6e24239023709 to your computer and use it in GitHub Desktop.
Regular Expressions
// RFC.re - Regular expression for "Registro Federal de Contribuyentes" validation
^[A-Za-zÑñ&]{3,4}[0-9]{2}[0-1][0-9][0-3][0-9][A-Za-z0-9]{2}[0-9Aa]$
// Sean Allen's Regex for email
[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}
// Lea Verou's Regex for email (https://www.youtube.com/watch?v=M7vDtxaD7ZU&t=1h07m42s)
// TL;DW: Practicality > Precision
^\S+@\S+\.\S+$
/*
Sean Allen's Regex for password
Regex restricts to 8 character minimum, 1 capital letter, 1 lowercase letter, 1 number
If you have different requirements a google search for "password requirement regex" will help
*/
(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment