in reply to Re: url to html regex problem
in thread url to html regex problem
I swear this works on windows, but not our BSD. Any speculation on what could cause that? Thanks..my $urls = '(http|telnet|gopher|file|wais|ftp|mailto)'; my $ltrs = '\w'; my $gunk = '/#~:.?+=&%@!\-'; my $punc = '.:?\-'; my $junk = qq~="'>~; # added my $any = "${ltrs}${gunk}${punc}"; $text =~ s{([^$junk]\s*\b)($urls:[$any] +?)(?=[$punc]* [^$any]|$) }{$1 +<a href="$2">$2</a>}igox; $text =~ s{^($urls:[$any] +?)(?=[$punc]* [^$any]|$) }{<a href="$1">$1< +/a>}igox;
|
|---|