note 47419 deleted from function.preg-replace by aidan
| From: | aidan@php.net | Date: | Sun, 05 Dec 2004 15:16:24 +0000 |
| Subject: | note 47419 deleted from function.preg-replace by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81400@lists.php.net to get a copy of this message | ||
Note Submitter: jrf
----
I believe Paul's might have made a typo:
$text = preg_replace("/(http:\/\/(.*))[\s]*/", "<a href=\\1>\\1</a>
", $text);
remembers the [\s] : meaning any whitespace character, while he probably meant [\S] which is any
non-whitespace character.
The corrected regex would be:
$text = preg_replace("/(http:\/\/(.*))[\S]*/", "<a href=\\1>\\1</a>
", $text);