The regex for email addresses in the MSDN website sucks a bit, it may work in code-behind but not in the .aspx file in which the server script for RegularExpressionValidator is found. Insert this string into the ValidationExpression property of your RegularExpressionValidator: (works like a charm)

"^[a-zA-Z0-9]+([\._]?[a-zA-Z0-9]+)*@[a-zA-Z0-9]+([\.-]?[a-zA-Z]+)?(\.[a-zA-Z]{2,3})+$"

I found this piece of code in this site: (it is found near the bottom of the page)
Thanks so much "djrulz"



Leave a Reply.