// check that email appears to be valid
if(!document.register.email.value.match(/^(.+)@(.+)\\.(.+)$/)){
alert('Please enter a valid email address.');
return false;
}
That regex is the same that I use in my PHP codes to check email addresses. But no matter what I put into the form I always get the alert.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
// check that email appears to be valid
if(!document.register.email.value.match(/^(.*?)@(.*?)\\.(.*?)$/)){
alert('Please enter a valid email address.');
return false;
}
This still accepts anything also.
When using other regexes I found that using \w instead of [a-z0-9_] works and the group of valid characters doesn't.
so maybe I need something like /^(\w+)@(\w+)$/
I dunno =/
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
The dot after the @ has two backslashes before it. This isn;t needed when you're not inside a string. It's reading as literal slash fllowed by any character.
Apart from this that regex should work for any address of the form name@zone.tld