How to validate an email address using RegexValidator

By Ghanashyam Nayak Nov 16, 2011
Using the RegexValidator, you can check and validate an email address and display a proper message.
See Below Code :

( @"^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@"
+ @"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\."
+ @"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|"
+ @"([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$"
, MessageTemplate="Please Enter Correct Email Id..."

Ghanashyam Nayak
Ghanashyam Nayak

To know more about me, you can follow me on Facebook :