Re: [MacPerl-AnyPerl] the /e modifier

[email protected] (Bart Lateur) Sun, 21 Apr 2002 15:11:21 +0200
Newsgroups perl.macperl.anyperl
Organization MediaMind
Message-ID <[email protected]>
On Sun, 21 Apr 2002 16:08:44 +0800, allan wrote:

>s/(<pre>>.+?<\/pre>)|(.*?)/&onesub($1)||&anothersub($2)/igesms;
        ^^
Perhaps this is part of your problem.

Anyway, the syntax you're looking for, is IMO more like


s/(<pre>.+?<\/pre>)|(.*?)(?=<pre|$)/$1?onesub($1):anothersub($2)/ismeg;

(although the order of the options doesn't really matter)

Note that a bare

	(.*?)

will match nothing, as you have nothing to anchor it against. Match
minimal until what? So I've chosen to pick a "match to the next "<pre"
or to the end of string. You can change it if you dont't like it.

-- 
	Bart.