Yes! Except the above breaks, because the inner s/// kills the existing capture groups. So, those must be saved. E.g.
s{ ( ^ \#[ ]START \n ) ( .*? ) ( ^ \#[ ]END \n ) }{ my @m = @{^CAPTURE}; $m[ 0 ] . ( $m[ 1 ] =~ s/^[ #]+//rmg ) . $m[ 2 ]; }xmesg;
In reply to Re^2: s///g within m//g regions
by almr
in thread s///g within m//g regions
by almr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |