http://qs1969.pair.com?node_id=290635


in reply to Re: Re: TIMTOWTDI
in thread LCCS time complexity

Thanks for the   $text =~ s/\[[^\]]*\]/ /g; tip; that is better. As for the  /m on these
$text =~ s/^\s+//; $text =~ s/\s+$//;
I think I'd put the  /m on the third RE
$text =~ s/\s+/ /m; #yes?
so taken together the triple REs mean: "remove leading whitespace, trailing whitespace, and make all interior whitespace (even across line breaks) into single spaces".

Many thanks for the OT-but-useful teaching!

rkg