[Mailman-Users] Regexp help - Matching Subjects to Hold Posts in Mailman 2.0.11

David Powell tech at yanq.org.au
Tue May 31 07:44:00 CEST 2005

Thanks for the help, to respond...

> Life will be much easier for this kind of task if you upgrade to
> Mailman 2.1.x; 2.1.6 is current.

Agreed - I don't administer the server, but understand we're waiting for 
the new stable release of Debian (any day now).

> Really, you should invest in Jeffrey Friedl's book, _Mastering Regular
> Expressions_.  I'm sure there are many on-line tutorials, too.  This
> is not the channel for questions that arise because you don't
> understand how to construct a regular expression.  For now, try
> subject:[ \t]*\[SPAM
> subject:[ \t]*\\[SPAM

Neither of these worked.  I'll take a look at that book though, ta. 
Also I understand that this isn't a regexp help list, and sorry if I've 
wasted some bandwidth.

However, in my defence, prior to posting I did look at quite a few 
online tutorials, and then tested out a few expressions on some text 
files.  When I found a few expressions that worked I used these in 
mailman(without luck obviously).

Following Stephen's suggestions, I've tried a few more.  What I did was 
place the following lines (among others) in a text file.  As I'm not 
sure exactly how the subject header is formatted, I wanted something 
that would find all off the following:

subject:	[SPAM 07.49] Stop your computer from crashing
subject: [SPAM 07.49] Stop your computer from crashing
subject:[SPAM 07.49] Stop your computer from crashing
Subject:	[SPAM 07.49] Stop your computer from crashing
Subject: [SPAM 07.49] Stop your computer from crashing
Subject:[SPAM 07.49] Stop your computer from crashing

One line has a tab b/w ":" and "[SPAM", another a space and the third 
nothing.  The other thing I wasn't sure about was if the first letter of 
subject is uppper case or not.

The expression I found that matched all 6 lines (using grep) was:

I also used the find function in KATE, and found that it preferred: 

(using [\t] didn't match the lines with a tab)

Neither of these worked in mailman, so I tried with just upper, then 
lowercase 's' to start with (i.e. subject:.*\[SPAM and Subject:/* etc ).

This hasn't worked either.  So I guess I'm at a loss.  I've got my head 
around regular expressions enough to find what I want in a text file, 
but can't get it work in Mailman.

Am I dumber than I think (very possible ;->) or is there something about 
the way that Mailman handles regexps that I've missed?



More information about the Mailman-Users mailing list