note 39683 deleted from function.preg-replace by didou
| From: | didou@php.net | Date: | Mon, 10 Jan 2005 03:24:24 +0000 |
| Subject: | note 39683 deleted from function.preg-replace by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-83029@lists.php.net to get a copy of this message | ||
Note Submitter: dma147 at web dot de
----
I've a little correction to the upper post from "syd_egan at hotmail dot com".
To parse urls with a "-" or something else in it too, the preg_replce must look like this:
$text = preg_replace( "
(http|ftp)+(s)?:(//)((\w|\.|\-|_)+)(/)?(\S+)?i",
"<a href=\"\\0\" target=\"_blank\">\\4</a>", $text);
:)