I am building an MVC 4 web application and using Fluent Validation when validating some of my ViewModels.
I need to validate Email addresses and I was using this regular expression, it's the default one that comes in the AccountModels class when you create a default MVC application in Visual Studio
RuleFor(x => x.ConfirmEmail)
.Matches(@"^[\w-]+(\.[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$")
.WithMessage("Please enter a valid email address");
However, my client has told me this is not accepting email addresses which include apostrophes before the @ sign.
I am not good with regular expressions at all, so could someone please help me to amend this reg expressive to allow for apostrophes before the @ sign?
Thanks in advance.
Update
I had put in the wrong code sample, please see the regular expression now - this is the one that does not accept apostrophes.