in reply to Monks' Expression
If you actually put this in a file and run it with Perl, you'll get:my $text = "Here is [id=327]a very cool document[/id] for you"; $text =~ /\[id=([0-9]*)\](.*)\[\/id\]/i; my $tag = "<A HREF=\"/cgi-bin/coolcode.pl?id=$1\">$2</A>"; my $before = $`; my $after = $'; print "$before$tag$after\n";
Just as you'd expect and (hopefully) want. :-)Here is <A HREF="/cgi-bin/coolcode.pl?id=327">a very cool document</A> + for you
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Monks' Expression
by eg (Friar) on Jan 22, 2001 at 13:34 UTC | |
by Segfault (Scribe) on Jan 22, 2001 at 23:51 UTC |