Skip to content

Instantly share code, notes, and snippets.

@nunofilipecosta
Created September 18, 2013 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nunofilipecosta/6607916 to your computer and use it in GitHub Desktop.
Save nunofilipecosta/6607916 to your computer and use it in GitHub Desktop.
EmailAttribute
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