Bill wrote:

> I thought my regexps were up to snuff until they processed this url:
>
> http:[EMAIL PROTECTED]
>
> Anybody have a regexp that can parse for both http & mailto links and
> turn that into an http link -without- turning it also into a mailto
> link?

Thought you might like to see what I'm using now.  The below doesn't work
for the above url.

//turn urls into links
 $text = eregi_replace("(http://[^ ]*)","<a href=\"\\1\">\\1</a>",$text);

  //turn e-mail into mailto links
  $text = eregi_replace("([
]+)([[:alnum:]\.\-]+\@[[:alnum:]\-]+\.[\.[:alnum:]]+)([^\.[:alnum:]])","\\1<a

  href=\"mailto:\\2\";>\\2</A>\\3", $text);

I'm open to ideas.

kind regards,

bill


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to