Greetings fellow monks,
This seems like such a simple problem, and perhaps it is and my brain is just extra slow today, but I need your help. I've got a rather long text string in a scalar from which I'd like to filter out multiple white spaces, converting them into just a single space per instance. Simple enough:
$text =~ s/\s+/ /g;However, I'd like to not do this between a starting label and ending label. Here's some example text:
A Bridge Too Far Hosted by Rod Stuart Friendly Skys 42 STARTPRESERVE Life, the universe... and Everything STOPPR +ESERVE X-Files HotWheels are cool More movies on Fox File server
Basically, I'd love to have a simple regex that does the /\s+/ /og except not do anything between STARTPRESERVE and STOPPRESERVE. Any thoughts? (My appologies if this is really basic. I'm having a bad brain-day.)
-gryphon
code('Perl') || die;
In reply to RegEx to filter \s not between labels by gryphon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |