If there were repeated, contiguous newlines, that would only avoid replacing the final newline.
c:\@Work\Perl\monks>perl -wMstrict -le "my $line = qq{HeHi\n\n\nHo}; print qq{[$line]}; ;; $line =~ s/Hi\s*(?=\n)//; print qq{[$line]}; " [HeHi Ho] [He Ho]
Give a man a fish: <%-(-(-(-<
In reply to Re^2: \s matches newline in regex?
by AnomalousMonk
in thread \s matches newline in regex?
by Only1KW
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |