in reply to regex to identify http:// in html
Hi Massyn, Try this,
my $str="McGlaughlin http://www.karayiannis.com and http://www.samy.co +m"; $str =~ s/\b((?:http\:\/\/)|(?:www\.))([^ ]+)/<a href=\"$&\">$&<\/a>/s +gi; print $str; __END__ McGlaughlin <a href="http://www.karayiannis.com">http://www.karayianni +s.com</a> and <a href="http://www.samy.com">http://www.samy.com</a>
Regards,
Velusamy R.
|
|---|