procmail
[Top] [All Lists]

Re: [pro] Re: Duplicates sent from lists

2004-03-09 00:40:03
On Mon, 8 Mar 2004, LuKreme wrote:
* ^To:[         ]*\/.*
You realize that that will start MATCH with whatever character is 
after the colon and will not skip spaces or tabs, don't you?
I did notice that in the logs, but the resulting $MATCHes are being 
used only for the egrep, so it seemed pointless to fix.
should be
* ^To:(.*\<)?\/.*
right?

Nope. Regular expressions are 'right side greedy'. It will first try for
the valid combination of 'expression in paranethesis occurs ZERO times'
followed by 'any string of any length'. It would only look for the
non-zero length match for the parenthesized test if the right side test
somehow did not match on its own without it. 

You want *this* for your test:
* ^To:[  ]*\/[^  ].*

The square brackets containing 'space tab' of course. This way, the
'greedy' right side test finds the *largest* possible string that starts
with a NON-space/tab, then completes the match by looking for an optional
space/tab in front of it. But your MATCH string starts with the first
non-space/tab character.......

- Charles


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail