Re: Regex for email validation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 6:30 PM +0200 8/27/08, Per Jessen wrote:
Well, I left that for the OP to figure out.  Still, your regex is
worse - a domain name cannot contain '%'.  The only valid characters
for a domain name are letters, numbers and a hyphen.  Also, maximum
length for a domain name is 64 characters, which could/should be
checked too.

Well, I stole that regex anyway -- I agree that % should have not been there.

No, they can't.  There are no 8-bit characters allowed in an
email-address.  Check out RFC2821.

You can throw all the facts and documentation you want at me, but the left side of the @ has always been open to anything you want. The right side of the @ has had to deal with 7-bit limitation (the DNS problem). But, considering the work that the IDNS has done, (circa 2000) we can use Unicode characters on both sides of the @.

However, the software (browsers and email apps) may/may-not be able to deal with it, as shown by my recent example of:

 > tedd@à.com

 is a legal and working email address.

If that reads "tedd(at)<space>.com", it might be valid on your system,
but not in public.

The email address is perfectly valid, and works, but our definition of "public" is apparently different.

I claim if it's valid on any system, then it's public. I don't hold to the notion that if M$ doesn't recognize it then it isn't public. M$ has always had it's collective head up it's vested interest butt anyway.

For demonstration Safari has absolutely no problems dealing with IDNS, whereas all IE's do. To prove my point, if you have Safari, try entering option v into the browser URL box and hit return. You don't have to enter anything else (i.e., no http://, www, or dot com).

What will happen is that you will be automagically transported to one of my sites where the url is square-root dot com. However if you're dealing with one of the leading "also-ran" IE browsers, then you'll see the PUNYCODE equivalent, which was never intended to be seen by end users anyway. Just another example of how M$ always has a better idea.

So, regardless of the documentation, which may be outdated, I know that Unicode characters can be used in IDNS and thus on both sides of the @, but it's the software that needs to catch up to the technology.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux