Created
September 18, 2013 11:35
-
-
Save nunofilipecosta/6607916 to your computer and use it in GitHub Desktop.
EmailAttribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel.DataAnnotations; | |
namespace MocheRandomGeneration.Core.Utilities.ValidationAttributes | |
{ | |
[AttributeUsage(AttributeTargets.Property)] | |
public sealed class EmailAttribute : RegularExpressionAttribute | |
{ | |
public EmailAttribute() : base(@"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}") | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment