procmail
[Top] [All Lists]

Re: Match operator and massive regex

2001-12-05 08:54:43
I didn't have a fall through group set to catch any that didn't have a
matching Newsgroups header.  However that has never occured since I
only download from the groups that do match.  And in fact the messages
that show up in `1x..in', do have matches as I showed in previous
post.

*Now* I get it.  I hadn't properly understood earlier - I thought that
you only wanted to match the first listed newsgroup, but you want to
match the frist matching newsgroup, which might not be the first listed
one.  I misread your explanation.

The 'Newsgroup:' condition as it stands will match only on the first
newsgroup in a list - that is, 'Newsgroup:' followed by whitespace,
followed by a newsgroup name.
But the newsgroup you want might be later in the list since the list
might consist of:

  Newsgroups: rec.fog.plaiting,gnu.emacs.help

and you want the 'gnu.emacs.help'.

A suitable recipe might be:

 :0
 * ^Newsgroups:(.*,)?[     ]*\/(...etc...)
 * ^Path:
 {
    DELIVERY=$MATCH

   :0 :
   1x.${DELIVERY}.in
 }

The extra '(.*,)?' will permit the condition to skip over any
non-matching newsgroups on the Newsgroups line, but will stop at the
first matching one it finds.  Does that make sense to you?

Regards,
Martin
-- 
Martin McCarthy                 /</                  PGP key available
    `Procmail Companion'        \>\  http://www.ancient-scotland.co.uk
     Addison Wesley             /</    http://www.ehabitat.demon.co.uk
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>