note 4820 deleted from function.ereg-replace by jimw

From: Date: Fri, 02 Nov 2001 01:47:21 +0000
Subject: note 4820 deleted from function.ereg-replace by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-20181@lists.php.net to get a copy of this message
I wrote the following regex to convert text in hyperlinks. I think works slightly better than the one already posted. $tmp = ereg_replace("http://(([A-Za-z0-9.\-])+)([a-zA-Z0-9])((/(([a-zA-Z0-9])*))*)((.([a-zA-Z0-9])+)*)", "<a href=\"\\0\">\\0</a>",$tmp);

« previous php.notes (#20181) next »