Re: Converting URL's to hyperlinks.
| From: | Lupus Michaelis | Date: | Wed, 09 Sep 2009 01:22:25 +0000 |
| Subject: | Re: Converting URL's to hyperlinks. | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-297799@lists.php.net to get a copy of this message | ||
Sorry for the lag.
Daevid Vincent a écrit :
Thanks :)OP ?Original Poster
Blah blah blah. I've used this code for about 6 years now and have yet to find emails that it didn't work for. If someone has some funky (whacky) RFC extremity, then so be it. That's their problem. Most people have NORMAL emails that follow the above. I faced a professionnal issue because of a lazy programmer (a Delphi component that was not aware about "Toto man"@example.com). What you consider normal e'mail is a subset that is not interoperable. And I hate that.
But you are correct, I have revised it to be a little more forgiving of some allowed characters... preg_replace("/([\w\.\-_]+@[\w\.\-_]+\.\w{2,6})/i", You can revised your regex to fit to the new kind of email. But it is smarter to use the right tool (like filter_vars).Yeah, I know, I feel like some spanish windmill hunter. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org