package xm::grabitemincl;
use strict;
use xm::o;
"
will look for all texts that follow a (global) ITEM[A-Z]* section
which has an include-line and then mark these text areas as ITEMINCL.
"}
my $in = shift;
my $x = sub {
my ($a,$b) = @_;
if ($b !~ m/<CPRE>\s*\#\s*include\b/s)
{
return $a.$b;
}else{
return $a."<ITEMINCL>".$b."</ITEMINCL>";
}
};
$in =~ s{(</ITEM:?[A-Z]*(?:\s[^<>]*)?>(?!</?ITEM))
( (?:.(?!</?ITEM))*.? )(?=<ITEM|$)
}
{
&$x($1,$2)
}gsex;
$in =~ s{(^(?!</?ITEM))
( (?:.(?!</?ITEM))*.? )
}
{
&$x($1,$2)
}gsex;
return $in;
}
return xm::o::args_stdin(@_, DESC); }
return DO(xm::o::args_stdin(@_, DESC)); }
1;