in reply to Re: RegEx to filter \s not between labels
in thread RegEx to filter \s not between labels
++I0! Minor changes to remove the start/stop markers which I think was desired:
(: - tye (but my friends call me "Tye")# The golfish way: $text =~ s#(\s)\s+|STARTPRESERVE(.*?)STOPPRESERVE#$1$2#gs; # Update: Oops! This fails if a run # of whitespace doesn't start with ' '. # or, if you don't like warnings: $text =~ s#\s{2,}|STARTPRESERVE(.*?)STOPPRESERVE# defined $1 ? $1 : " " #seg;
|
---|