in reply to Monks' Expression
My regular expression should take [id=###]blahblah[/id] and replace it with <a href="/cgi-bin/coolcode.pl?id=###">blahblah</a>.The following should work:
my $text = "[id=###]blahblah[/id]; my $targetURL = "/cgi-bin/coolcode.pl?"; $text =~ s/.*[(id=.*)](.*)[\/id]/<a href=\"$targetURL\1\">\2<\/a>/gs;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Monks' Expression
by I0 (Priest) on Jan 22, 2001 at 02:43 UTC | |
by repson (Chaplain) on Jan 22, 2001 at 04:18 UTC | |
by I0 (Priest) on Jan 22, 2001 at 06:58 UTC | |
by merlyn (Sage) on Jan 22, 2001 at 07:00 UTC | |
by repson (Chaplain) on Jan 22, 2001 at 07:12 UTC | |
| |
by sierrathedog04 (Hermit) on Jan 22, 2001 at 03:12 UTC |