Re: repair comb-quoting
"'Ruud H.G. van Tol' [email protected] [sed-users]" <[email protected]> Fri, 22 Jan 2016 17:47:05 +0100
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <[email protected]> |
On 2016-01-22 16:42, Sven Guckes [email protected] [sed-users] wrote: > http://www.guckes.net/examples/gg.tw72.comb.txt A Perl alternative: concatenate a short line to its previous line, but only if it has the same prefix. perl -e' my $buf= join "", <>; $buf =~ s/^(>(?>(?: *>)*) )(.*)\n^\1(.{1,20})$/$1$2 $3/mg; print $buf; ' ~/mail.txt -- Ruud