Hello all,
I'm a programmer who's been assigned to write a procedure that checks if an email address could be correct (as it doesn't actually have to exist, but it must at least be made up correctly) and am trying to find out what characters you can and cannot use in an email address.
I came across this function in this forum:
I assume that the var called filter checks for characters that cannot be in the email address, but I do not understand it. Can anyone please explain this to me?
Should you need it, the rest of the post can be found here:
BobbaFet ![[bobafett] [bobafett] [bobafett]](/data/assets/smilies/bobafett.gif)
Everyone has a right to my opinion.
[/b]
Great Delphi Websites faq102-5352
I'm a programmer who's been assigned to write a procedure that checks if an email address could be correct (as it doesn't actually have to exist, but it must at least be made up correctly) and am trying to find out what characters you can and cannot use in an email address.
I came across this function in this forum:
Code:
function checkemail(){
var str=document.validation.emailcheck.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address!")
testresults=false
}
return (testresults)
}
</script>
I assume that the var called filter checks for characters that cannot be in the email address, but I do not understand it. Can anyone please explain this to me?
Should you need it, the rest of the post can be found here:
![[bobafett] [bobafett] [bobafett]](/data/assets/smilies/bobafett.gif)
![[bobafett] [bobafett] [bobafett]](/data/assets/smilies/bobafett.gif)
Everyone has a right to my opinion.
[/b]
Great Delphi Websites faq102-5352