Skip to content

Instantly share code, notes, and snippets.

@tfaki
Last active March 7, 2022 13:26
Show Gist options
  • Save tfaki/b70493e6f9b8b6cba0e3d06598126dc8 to your computer and use it in GitHub Desktop.
Save tfaki/b70493e6f9b8b6cba0e3d06598126dc8 to your computer and use it in GitHub Desktop.
/* PHONE REGEX REGION */
# PHONE_REGEX_1 = "^((\\(\\d{3}\\))|\\d{3})[- .]?\\d{3}[- .]?\\d{4}$"
--> validation: (202) 555-0125
# PHONE_REGEX_2 = "^(\\+\\d{1,2}( )?)?((\\(\\d{3}\\))|\\d{3})[- .]?\\d{3}[- .]?\\d{4}$"
--> validation: +90 (202) 555-0125
/* PASSWORD REGEX REGION */
# PASSWORD_REGEX_1 = “^” +
“(?=.*[@#$%^&+=])” + // at least 1 special character
“(?=\\S+$)” + // no white spaces
“.{4,}” + // at least 4 characters
“$”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment