Beispiel #1
0
 public static void AssertIsValid(string email)
 {
     AssertionConcern.AssertArgumentMatches(@"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z",
                                            RegexOptions.IgnoreCase,
                                            email,
                                            "Email inválido");
     //if (!Regex.IsMatch(email, @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z", RegexOptions.IgnoreCase))
     //  throw new Exception("Email inválido");
 }
Beispiel #2
0
 protected void SelfAssertArgumentMatches(string pattern, RegexOptions regexOptions, string stringValue, string message)
 {
     AssertionConcern.AssertArgumentMatches(pattern, regexOptions, stringValue, message);
 }