Skip to content

Instantly share code, notes, and snippets.

@mvrmoreira
Created March 9, 2015 21:33
Show Gist options
  • Save mvrmoreira/8224bd4143f256b569ac to your computer and use it in GitHub Desktop.
Save mvrmoreira/8224bd4143f256b569ac to your computer and use it in GitHub Desktop.
Método que veirica se a string passada está no formado +x55(x21)9999999999
/// <summary>
/// Método que veirica se a string passada está no formado +x55(x21)9999999999
/// </summary>
/// <param name="phoneNumber"></param>
/// <returns></returns>
public bool CheckPhoneMask(string phoneNumber) {
bool returnValue = StringUtility.IsARegexMatch(@"^(?<DDI>\+?[0-9]{1,3})?\((?<DDD>[0-9]{1,3})\)(?<NUMBER>[0-9]{1,9})$", phoneNumber.Replace("-", ""));
return returnValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment