Skip to content

Instantly share code, notes, and snippets.

@Jalalx
Created December 10, 2017 11:17
Show Gist options
  • Save Jalalx/534aff5753c6c84b08937c87ea5c64ce to your computer and use it in GitHub Desktop.
Save Jalalx/534aff5753c6c84b08937c87ea5c64ce to your computer and use it in GitHub Desktop.
Regex to detect Irans mobile numbers
public static bool IsMobileNumber(this string value)
{
return Regex.IsMatch(value ?? string.Empty, @"^((\+9|\+989|\+\+989|9|09|989|0989|00989)(01|02|03|10|11|12|13|14|15|16|17|18|19|20|21|22|30|31|32|33|34|35|36|37|38|39|90))(\d{7})$");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment