+ // turn urls into links
+ $the_note = preg_replace(
+ "/((mailto|http|ftp|nntp|news):.+?)(>|\\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):.+?)(>|\s|\)|"|\.\s|<|$)/S', '<a href="\1">\1</a>\2', $the_note );
Nuno
P.S.: BTW, thanks for reviewing some livedocs' patches.