I've been using this Regex to convert single text links into Html links. It works fine for plain text, but whenever someone inserts a proper html link or an iframe or anything that uses a http:// preceeded text, it makes it a link. To explain:
preg_replace('/([hf][tps]{2,4}:\/\/[^ \t\n\r]+[^ .\t,\n\r\(\)"\'])/', '<a href="$1">$1</a>', $string)
makes the job, but it ruins:
<a href='...'>...
, <iframe src='...'>...
and every other a mess.
I've been trying to use:
^[^'"]*([hf][tps]{2,4}:\/\/[^ \t\n\r]+[^ .\t,\n\r\(\)"\'])$
But it makes:
juanito mario http://...
become
<a href="juanito mario http://...">juanito mario http://...</a>