note 79593 added to function.preg-replace
| From: | erikatteshackdotcom at osu1 dot php dot net | Date: | Tue, 04 Dec 2007 22:15:28 +0000 |
| Subject: | note 79593 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132811@lists.php.net to get a copy of this message | ||
I further refined the regular expression to support underscores in the URL as well as support a
string that ends in a parenthesis, for example, (see: http://www.php.net)
$content_text = preg_replace("/[^<> ]([a-zA-Z]
+:\/\/[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/
\*\_\.\-\?\&\%\=]*)([^\s|\)|\.|\,<])/i",'<a href=
"$0" target="_blank">$0</a>',$content_text);
----
Server IP: 64.71.164.2
Probable Submitter: 128.104.174.154
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/79593
Del: integrated -- https://master.php.net/note/delete/79593/integrated
Del: useless -- https://master.php.net/note/delete/79593/useless
Del: bad code -- https://master.php.net/note/delete/79593/bad+code
Del: spam -- https://master.php.net/note/delete/79593/spam
Del: non-english -- https://master.php.net/note/delete/79593/non-english
Del: in docs -- https://master.php.net/note/delete/79593/in+docs
Del: other reasons-- https://master.php.net/note/delete/79593
Reject -- https://master.php.net/note/reject/79593
Search -- https://master.php.net/manage/user-notes.php