RegularExpressionAttribute – How to make it not case sensitive for client side validation?
I created this attribute which allows you to specify RegexOptions. EDIT: It also integrates with unobtrusive validation. The client will only obey RegexOptions.Multiline and RegexOptions.IgnoreCase since that is what JavaScript supports. [RegularExpressionWithOptions(@”.+@example\.com”, RegexOptions = RegexOptions.IgnoreCase)] C# public class RegularExpressionWithOptionsAttribute : RegularExpressionAttribute, IClientValidatable { public RegularExpressionWithOptionsAttribute(string pattern) : base(pattern) { } public RegexOptions RegexOptions { get; … Read more