On 1/26/06, Richard K Miller [EMAIL PROTECTED] wrote:
@(http://\S+)(?!\.)@ -- this still captures everything
@(http://\S+?)(?!\.)@-- this captures too little
hmm maybe this would work?
@http://.+(?=\.)@
On 1/23/06, Richard K Miller [EMAIL PROTECTED] wrote:
function link_the_links($s) {
return preg_replace('@(http://[^\s]+)@sm', 'a href=$1$1/a', $s);
}
I've got to somehow ignore the trailing period if it is present.
if ($s[strlen($s)-1] == '.'){
$s = substr($s, 0, -1);
}
-ahmed
On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:
On 1/23/06, Richard K Miller [EMAIL PROTECTED] wrote:
function link_the_links($s) {
return preg_replace('@(http://[^\s]+)@sm', 'a href=$1$1/a',
$s);
}
if ($s[strlen($s)-1] == '.'){
$s = substr($s, 0, -1);
}
oops! sorry i
On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:
On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:
On 1/23/06, Richard K Miller [EMAIL PROTECTED] wrote:
function link_the_links($s) {
return preg_replace('@(http://[^\s]+)@sm', 'a href=$1$1/a',
$s);
}
try looking ahead in the
On Jan 25, 2006, at 10:01 AM, Ahmed Saad wrote:
On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:
On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:
On 1/23/06, Richard K Miller [EMAIL PROTECTED] wrote:
function link_the_links($s) {
return preg_replace('@(http://[^\s]+)@sm', 'a href=$1
I wrote a little function to put anchor tags around a URL. We're
using it to make URL's in paragraphs of text linkable:
function link_the_links($s) {
return preg_replace('@(http://[^\s]+)@sm', 'a href=$1$1/a', $s);
}
Its only flaw (besides a goofy name) is that if a link comes at the
6 matches
Mail list logo