I have written regular expression which converts text links into clickable link. The code works fine however when an HTML tag is passed it mess the code
Here is my code
$text = preg_replace('#(?<![">])((http|ftp)s?://[^<>\s]+)#i', '<a href="\\0">\\0</a>', $text );
It is suppose to skip following element
<a href="http://www.yahoo.com">Yahoo</a>
but it does not.. what am I doing wrong?
Thanks