Gossamer Forum
Quote Reply
global to make auto URL
Hi,

I am using the following in a global to automatically turn http://.... into an active link.

Code:
$tag =~ s,(https?://[\w\.-/]+),<a href="$1" target="_blank">$1</a>,sg;
$tag =~ s,\[([/\w]+)\],<$1>,g;


It works for most URL's but it breaks if there is a - in the url. Ex: http://www.my-site.com

Any suggestions?

Klaus

http://www.ameinfo.com