Re: cvs: livedocs / livedoc_funcs.php

From: Date: Wed, 09 Feb 2005 18:45:44 +0000
Subject: Re: cvs: livedocs / livedoc_funcs.php
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969366454@lists.php.net to get a copy of this message
+                // turn urls into links
+                $the_note = preg_replace(
+ "/((mailto|http|ftp|nntp|news):.+?)(&gt;|\\s|\\)|\"|\\.\\s|<|$)/",
+                        "<a href=\"\\1\">\\1</a>\\3",
+                        $the_note
+                );
+
A slightly optimized version would be:
               $the_note = preg_replace(
                      '/((?:mailto|http|ftp|nntp|news):.+?)(&gt;|\s|\)|"|\.\s|<|$)/S',
                      '<a href="\1">\1</a>\2',
                      $the_note
               );
Nuno P.S.: BTW, thanks for reviewing some livedocs' patches.

« previous php.doc (#969366454) next »