[devtalk] ASP help

David Precious dave at preshweb.co.uk
Tue Oct 27 16:59:52 GMT 2009


Robert Hoenig wrote:
> You could check that javascript is off and then use an asp script
> validation.  Here's the asp script I use.

Heh, why must people re-invent the email validation wheel so much?

>    ' has no more than 3 chars after last "."
>    elseif len(theAddress) - instrrev(theAddress,".") > 3 then
>       chkEmail = 1

What about all the new TLDs - .aero, .museum etc?

And, to be awkward, what about e.g. bob@[127.0.0.1] (which is valid, if 
very-rarely used :) )

>       ' has only one "@"

Technically, I believe "Dave @ work"@example.com is valid, although 
again rarely seen.

 >       ' chk each char for validity

That allows characters in places they shouldn't be allowed, and 
disallowed characters that should be allowed.

e.g. bob+somelist at example.com should be accepted, bob at example_host.com 
shouldn't be

I'd strongly recommend using whatever libraries your language of choice 
provides to validate email addresses, rather than doing it for yourself!

Cheers

Dave P




More information about the devtalk mailing list