
localfilmmaker
stranger
May 8, 2001, 11:11 AM
Post #2 of 2
(739 views)
|
You can try this:
my $text = 'this is text with a link to http://www.perl.com and to www.perldoc.com'; $text =~ s!(^|\s)(http://\S+)!<a href="$2">$2</a>!ig; # get all 'http://' links $text =~ s!(^|\s)(www\.\w+\.\S+)!<a href="http://$2">$2</a>!ig; # get anything that simply starts 'www.' print $text; This seems to work, but you may try tweeking it to make it more robust. -localfilmmaker Spencer Christensen spencer@mecworks.com
|