You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
463 B

11 years ago
  1. 
  2. namespace Sevomin.Models.Helpers
  3. {
  4. using System.ComponentModel.DataAnnotations;
  5. public class EmailValidationAttribute : RegularExpressionAttribute
  6. {
  7. public EmailValidationAttribute()
  8. : base(@"^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-zA-Z0-9]{1}[a-zA-Z0-9\-]{0,62}[a-zA-Z0-9]{1})|[a-zA-Z])\.)+[a-zA-Z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$")
  9. {
  10. }
  11. }
  12. }