mirror of https://github.com/abpframework/abp.git
2 changed files with 36 additions and 0 deletions
@ -0,0 +1,20 @@ |
|||||
|
using System.Text.RegularExpressions; |
||||
|
|
||||
|
namespace Volo.Abp.Validation |
||||
|
{ |
||||
|
public class ValidationHandler |
||||
|
{ |
||||
|
private const string EmailRegEx = @"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"; |
||||
|
|
||||
|
public static bool IsValidEmailAddress(string email) |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(email)) |
||||
|
{ |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
/*RFC 2822 (simplified)*/ |
||||
|
return Regex.IsMatch(email, EmailRegEx, RegexOptions.Compiled | RegexOptions.IgnoreCase); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue