Click to See Complete Forum and Search --> : problem in an expression that checks email validity


michelvernet
04-16-2003, 03:42 AM
Hi, would someone tell me what I have to add in the expression below for my formmail to work ? In fact this expression doesn(t work with email addresses like xxx.xxx@xxx.xxx ( because of the . before the @ )
thanks

var verif = /^[a-zA-Z0-9_-.-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/
if (verif.exec(theForm.email.value) == null)
{
alert("Votre adresse email est probablement incorrecte...");
theForm.email.focus();
return (false);

cyberade
04-16-2003, 06:44 AM
When I tried the regular expression as you have it, I received an error of invalid characters in range.

I changed "-.-" to just "." and it seemed to work for me.