This is a bit weird, but it seems to work:
update: see merlin below. Now it works with nested PRESERVEs:
$text =~ s/\s+|(STARTPRESERVE(\d?).*?STOPPRESERVE\2)/${[$1,' ']}[!$1]/ +gs;
In reply to Re: RegEx filter \s ! between labels, part 2
by fglock
in thread RegEx filter \s ! between labels, part 2
by gryphon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |