in reply to Re: Re: url to html regex problem
in thread url to html regex problem

Well... if urls are always preceded by a > you could do a negative lookahead for a >... but that isn't the greatest...

                - Ant
                - Some of my best work - Fish Dinner

Replies are listed 'Best First'.
Re: Re: Re: Re: url to html regex problem
by Anonymous Monk on Oct 06, 2001 at 00:53 UTC
    I'd tried negative lookahead before without success. But your suggestion made me try harder and I finally got it to work! I had a problem with the order of the characters in $junk being strangely significant until I switched to single quotes:
    my $junk = '<>]="\''; $text =~ s{(?!$junk)\b($urls:[$any] +?)(?=[$punc]* [^$any]|$) }{<a hre +f="$1">$1</a>}migox;
    /me hugs suaveant