Regular expression for email
- by Nadeem
I tried the reg expression
^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+
for the email validation.
Since I want the user to allow submitting even with the empty email address.
So I changed the reg ex to
(^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+)?
But this expression accepts any email address without any validation.