ValidationHelper.cs 445 B

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