email check using javascript

Posted by Klbaiju under ASP.NET on 3/30/2012 | Points: 10 | Views : 959 | Status : [Member] | Replies : 4
hi, this is my email pattern using javascript.

var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;


this is working fine .
but my problem is i want to add on dot(.) on name part.
ie
KLBAIJU@yahoo.com is working fine.
but i need
KL.BAIJU@YAHOO.COM
some times namepart contains dot(.) some times doesn't contain dot(.)

how it is possible.

Regards

K L BAIJU




Responses

Posted by: Rajni.Shekhar on: 3/30/2012 [Member] Bronze | Points: 25

Up
0
Down
change it:, this will allow -, _ ' and .

var emailPat = /^(\".*\"|[A-Za-z_\-\'\.]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;



Thanks,
Rajni Shekhar

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: perfectchourasia-9163 on: 4/4/2012 [Member] Starter | Points: 25

Up
0
Down
"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-Innovator on: 4/4/2012 [Member] Bronze | Points: 25

Up
0
Down
try like this...
var EmailExp=/^[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]$/;

Join Hands Change lives
Thanks & Regards
Straight Edge Society

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 4/4/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

try this

  var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{1,4})$/;


R D Patel

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response