Skip to content

Instantly share code, notes, and snippets.

@gwixted
Last active December 18, 2015 11:20
Show Gist options
  • Save gwixted/5775301 to your computer and use it in GitHub Desktop.
Save gwixted/5775301 to your computer and use it in GitHub Desktop.
// PHONE VALIDATION ==================================
^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})$
// EMAIL VALIDATION ================================
^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$
// URL =============================================
^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment