Is there any way I could validate email against case insensitive mode. I could not use (?i) since it will throw me an exception on jquery. I want examples to work not only with a@gmail.co.uk, but also a@Gmail.co.uk.
Current regex looks like this below:
[RegularExpression(@"^(?=.*?\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b)((?!gmail\.co\.uk|\.con).)*$", ErrorMessageResourceName = "EnsureValidEmail", ErrorMessageResourceType = typeof(Resources.Global.Address))]
I have tried to use this with case insensitive mode (?i):
@"^(?i)(?=.*?\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b)((?!gmail\.co\.uk|\.con).)*$"
which resulted in jquery: Uncaught SyntaxError: Invalid regular expression: