I'd simplify, instead of trying to do it all with a regex.
- Split based on the STARTPRESERVE and STOPPRESERVE markers, stuff the results into an array;
- Do the $text =~ s/\s+/ /g; on the first and last elements of the array; and
- Reassemble using join.
--t. alex
"Nyahhh (munch, munch) What's up, Doc?" --Bugs Bunny