-
Email Validation
Hi, I need to be able to check if a email address is a valid email so people can't just type in stuff like "jfsajfsajk_jsdljdal".
My code:
If System.Text.RegularExpressions.Regex.IsMatch(Trim(txtEmail.Text), "^[a-zA-Z0-9]@{a-zA-Z0-9][\w\.-]*[a-zA-Z][a-zA-Z]*[a-zA-Z]$") = False Then
lblFeedback.Text = "Please enter a valid Email Address before submitting"
lblFeedback.ForeColor = Drawing.Color.Red
End If
But this isn't working for me, can you see where I went wrong.
Thanks.
-
Re: Email Validation
try out this
"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
OR
".+@.+\\.[a-z]+"
Thankx
Koolprasad2003
-
Re: Email Validation
that worked great, thanks mate.