Use .*? instead of .* for non-greedy matching.
Ronald
If you are doing your substitutions line by line then a text filter
like this will do it:
#! /usr/bin/perl
use strict;
my $on;
while (<>) {
$on = 1 and print and next if /<!-- Begin value list -->/;
$on = 0 if /<!-- End value list -->/;
if ($on) { # actions when switched on
s/.+/*****$&*****/;
}
print;
}
__END__
If you need to cross over line endings then the solution is a little different.
JD
You still need (?s) to allow . to match newlines.
Ronald
Try this:
(?s)(<!-- Begin value list -->)(.*?)(<!-- End value list -->)
Ronald