in reply to Re: Re: Monks' Expression
in thread Monks' Expression

$text =~ s#\[(id=[^\]]*)]([^\[]*)\[/id]#<a href="$targetURL$1">$2</a>#gs;

Replies are listed 'Best First'.
Re: Re: Re: Re: Monks' Expression
by I0 (Priest) on Jan 22, 2001 at 06:58 UTC
    $text =~ s#\[(id=[^]]*)]([^[]*)\[/id]#<a href="$targetURL$1">$2</a>#g;
      Hmm. Nothing in there about HTML-entitizing either the href or the body text. You probably knew that, but for the onlookers, the normal HTML quoting rules must apply here.

      -- Randal L. Schwartz, Perl hacker

        use CGI qw/:standard/; $text =~ s#\[(id=[^]]*)]([^[]*)\[/id]#a({href => $targetURL . $1}, $2) +#eg;