ultimate email validation function
Posted: Thu Mar 04, 2004 1:56 pm
May be this isn't the place to post this, and may be this has already been asked somewhere, but I didn't see it and there was nothing in the code sniplets forum about it. So forgive me if i am out of line, but here goes.
I need an ultimate email validation function. All the ones I have seen so far only do like half of what I need. so if any of you have a great email validation function, please let me know or direct me where it is posted elsewhere.
I need it to validate only the "+.-_0-9a-z" as defined in:
http://www.remote.org/jochen/mail/info/chars.html
I've seen some that validate for 0-9, a-z, but I need it to check and only allow for those and period, underscore, hyphen and plus sign too.
Also, so that it validates the format of the email address, and allows for country codes at the end (ie. bob@pacific.net.sg or bob@hcm.vnn.vn) and allows for all the types of domains like .info, .biz, .tv, .cx etc.
Also, it only allows one @ in the address, and makes sure there is at least one period in the address. And makes sure there isn't two periods used next to each other (ie. bob@hotmail..com) . And makes sure only ascii 7bit characters are used (ie. no chinese or japanese characters etc).
These are a few of the situations the function should check for, if anyone has any others to add. Anybody have such a function?
I need an ultimate email validation function. All the ones I have seen so far only do like half of what I need. so if any of you have a great email validation function, please let me know or direct me where it is posted elsewhere.
I need it to validate only the "+.-_0-9a-z" as defined in:
http://www.remote.org/jochen/mail/info/chars.html
I've seen some that validate for 0-9, a-z, but I need it to check and only allow for those and period, underscore, hyphen and plus sign too.
Also, so that it validates the format of the email address, and allows for country codes at the end (ie. bob@pacific.net.sg or bob@hcm.vnn.vn) and allows for all the types of domains like .info, .biz, .tv, .cx etc.
Also, it only allows one @ in the address, and makes sure there is at least one period in the address. And makes sure there isn't two periods used next to each other (ie. bob@hotmail..com) . And makes sure only ascii 7bit characters are used (ie. no chinese or japanese characters etc).
These are a few of the situations the function should check for, if anyone has any others to add. Anybody have such a function?