note 27780 added to function.preg-replace

From: Date: Wed, 18 Dec 2002 16:33:00 +0000
Subject: note 27780 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-41068@lists.php.net to get a copy of this message
Be aware that these "activate links" expressions (I haven't tried them all) tend to mangle fully formed hyperlinks. I.e., a user nicely hotlinks a word w/ a href= and you come through w/ a function to activate links and pow, the link is all garbled (although it should still work). I think the best solution would be to activate all links that aren't immediately preceded w/ a quote, but I'm not good w/ regex, so for now I'm taking the opposite approach: Require some kind of trigger for the activate link function. E.g., rather than look for http, www, etc., look for ~http, ~www, or some such thing. I haven't thought through what the best character might be. -- http://www.php.net/manual/en/function.preg-replace.php http://master.php.net/manage/user-notes.php?action=edit+27780 http://master.php.net/manage/user-notes.php?action=delete+27780 http://master.php.net/manage/user-notes.php?action=reject+27780

« previous php.notes (#41068) next »