Procmail recipe: extracting matched text
Michael Still
mikal at stillhq.com
Tue Dec 10 13:32:31 EST 2002
On Tue, 10 Dec 2002, David Gibson wrote:
> Erm.. are you sure that procmail's notion of regular expressions
> actually allows this at all?
Well, sorta. Based on Nemo's post, and therefore having enough information
to do a google effectively, I have reduced a 500+ line lists.rc (which
missed a few lists), down to:
:0c
* List-Id.*linux.*
! patchdetect at stillhq.com
:0:
* List-Id:.*<\/[^>]*
$MATCH
# Majordomo lists (sometimes don't have <>'s around the address
:0c
* X-Mailing-List.*linux.*
! patchdetect at stillhq.com
:0:
* X-Mailing-List:.*<\/[^>]*
$MATCH
:0:
* X-Mailing-List:.*\/[^>]*
$MATCH
:0:
* Newsgroups: \/.*
zzz-$MATCH
Which is very cool.
Mikal
--
Michael Still (mikal at stillhq.com) UTC +11 hours
More information about the linux
mailing list