ValidationHelper.cs 497 B

12345678910111213141516171819202122
  1. using Abp.Extensions;
  2. using System.Text.RegularExpressions;
  3. namespace WeApp.Validation
  4. {
  5. public static class ValidationHelper
  6. {
  7. public const string EmailRegex = @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$";
  8. public static bool IsEmail(string value)
  9. {
  10. if (value.IsNullOrEmpty())
  11. {
  12. return false;
  13. }
  14. var regex = new Regex(EmailRegex);
  15. return regex.IsMatch(value);
  16. }
  17. }
  18. }