[SLUG] Perl Madness

From: btt (btt@nethouse.com)
Date: Fri Aug 15 2003 - 11:20:38 EDT


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 archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:14:03 EDT