Skip to content

Instantly share code, notes, and snippets.

@Alexintosh
Created December 3, 2015 18:15
Show Gist options
  • Save Alexintosh/184f3d84924040932f7d to your computer and use it in GitHub Desktop.
Save Alexintosh/184f3d84924040932f7d to your computer and use it in GitHub Desktop.
Regex ex
UK NUMBERS
$scope.phoneRegex = /^(\s*(\s*^\+44\s*)|^(\s*4{2})|(\s*^0{2}4{2}\s*)|(\s*^0)\s*|)(\s*[123456789]\s*)(\s*\d\s*){8,9}\s*$\s*/;
//WARNING This regex will accept only UK numers (+447, 07)
$scope.phoneRegex = /^(\s*(\s*^\+44\s*)|^(\s*4{2})|(\s*^0{2}4{2}\s*)|(\s*^0)\s*|)(\s*[7]\s*)(\s*\d\s*){9}\s*$\s*/;
//Generic phone number
@Alexintosh
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment