Re: [MacPerl-AnyPerl] negative lookahead xhtml tag
[email protected] (Keary Suska) Tue, 17 Sep 2002 12:41:37 -0600
| Newsgroups | perl.macperl.anyperl |
|---|---|
| Message-ID | <B9ACD381.1318F%[email protected]> |
on 9/17/02 11:24 AM, [email protected] purportedly said: >> I think this will work pretty well: >> >> $src =~ s,(<img[^>]+)(?<!/)>,$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 XHTML compliant: $src =~ s|(<img.+?)(?: /)?>|$1 />|ig; Keary Suska Esoteritech, Inc. "Leveraging Open Source for a better Internet"