Perl doesn't have to unreadable. ;)
#!/usr/bin/perl
use strict;
use warnings;
my $prefix = qr/>\s+?/;
my $start = qr/-{71}/;
my $end = quotemeta('official policy or position of NKS or any of its employees.');
# Alternativly, set $end to ''.
while ($_ = readline ARGV) {
print unless (/^$prefix*? $start $/xm .. /^$prefix*? $end $/xm);
}
On Friday, August 15, 2003 at 12:10PM -0400, thor_consulting@yahoo.com wrote:
> this one worked on all the messages i tested but might be a little greedy in
> some cases:
>
> perl -ne 'if ( ! (
> /-----------------------------------------------------------------------/ ..
> /^\s*$/ ) ) { print }'
>
> thor
>
> ----- Original Message -----
> From: "btt" <btt@nethouse.com>
> To: <slug@nks.net>
> Sent: Friday, August 15, 2003 11:20
> Subject: [SLUG] Perl Madness
>
>
> > Hi,
> >
> > I was just a little bored so I thought I'd try my hand at writing a
> > little filter to try to remove the disclaimer footer for the list.
> >
> > Here's what i have so far:
> >
> > #!/usr/bin/perl -00
> >
> > my $q = '(\s*[>\|]+\s*)';
> > while (<>) {
> > s/^(($q+)*[\-\n]+)*\s*\n?($q+)?(This\s*list.*?its\s*employees\.)$//msg;
> > print;
> > }
> >
> > which seems to remove the ones added to each message and any quoted
> > remnants hanging around in replies. I was wondering if anyone sees a
> > better way to do it. I ran it on an mbox archive from 0308, and it got
> > em all, but the regexp reminds me of dog food. Maybe awk or sed would
> > be better?
> >
> > When I figure this out, I'm going to write one to encompass the yahoo-
> > and hotmail-added sigs. It'll be great!
> >
> > Cheers,
> > Bill
> > -----------------------------------------------------------------------
> > This list is provided as an unmoderated internet service by Networked
> > Knowledge Systems (NKS). Views and opinions expressed in messages
> > posted are those of the author and do not necessarily reflect the
> > official policy or position of NKS or any of its employees.
> >
>
>
> -----------------------------------------------------------------------
> This list is provided as an unmoderated internet service by Networked
> Knowledge Systems (NKS). Views and opinions expressed in messages
> posted are those of the author and do not necessarily reflect the
> official policy or position of NKS or any of its employees.
>
-- "There are three principal ways to lose money: wine, women, and engineers. While the first two are more pleasant, the third is by far the more certain." -- Baron Rothschild, ca. 1800 - GPG Fingerprint=D67D 2B75 53C6 9769 30E4 D390 239F C833 F32C F6F6 GPG KeyID=F32CF6F6
This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:22:03 EDT