Skip to content

Instantly share code, notes, and snippets.

@Haosvit
Created December 16, 2016 03:15
Show Gist options
  • Select an option

  • Save Haosvit/3b9cb1281cfdc9e1e4270ecf0d5a317e to your computer and use it in GitHub Desktop.

Select an option

Save Haosvit/3b9cb1281cfdc9e1e4270ecf0d5a317e to your computer and use it in GitHub Desktop.

#Email

@"^(?("")("".+?(?<!\)""@)|((0-9a-z)(?<=[0-9a-z])@))(?([)([(\d{1,3}.){3}\d{1,3}])|(([0-9a-z][-\w][0-9a-z]*.)+[a-z0-9][-a-z0-9]{0,22}[a-z0-9]))$"

!Regex.IsMatch(UserEmail, @"^(?("")("".+?(?<!\)""@)|((0-9a-z)(?<=[0-9a-z])@))" + @"(?([)([(\d{1,3}.){3}\d{1,3}])|(([0-9a-z][-\w][0-9a-z]*.)+[a-z0-9][-a-z0-9]{0,22}[a-z0-9]))$", RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250)

#Phone number
simple version
^[0-9]+$

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