[MacPerl-AnyPerl] negative lookahead xhtml tag

2002-09-17 Thread allan juul
hi we need to replace tags like: to: it seems so simple but i am on the verge of giving up understanding the negative lookahead logic. this is how far i have come (obviously not working) my $src = qq(); $src =~ s/(]+\/))>/$1\/>/ig; print $src anyone with a clearer mind that can help

Re: [MacPerl-AnyPerl] negative lookahead xhtml tag

2002-09-17 Thread Ronald J. Kimball
On Tue, Sep 17, 2002 at 12:00:45PM +0200, allan juul wrote: > hi > > we need to replace tags like: > > > > to: > > > > > it seems so simple but i am on the verge of giving up understanding the > negative lookahead logic. > > this is how far i have come (obviously not working) > > my $s

Re: [MacPerl-AnyPerl] negative lookahead xhtml tag

2002-09-17 Thread allan
"Ronald J. Kimball" wrote: > > my $src = qq(); > > $src =~ s/(]+\/))>/$1\/>/ig; > > print $src > > The negative lookahead part is fine, except that it doesn't actually match > the rest of the tag, so your replacement puts the /> in the middle of the > tag and leaves the rest intact. correct, i m

Re: [MacPerl-AnyPerl] negative lookahead xhtml tag

2002-09-17 Thread Keary Suska
on 9/17/02 11:24 AM, [EMAIL PROTECTED] purportedly said: >> I think this will work pretty well: >> >> $src =~ s,(]+)(?,$1 />,ig; > > > yes of couse, lookbehind ;) > > hmm, would it be possible to actually do it without using lookbehind Yes, if you don't mind re-writing tags that are already