procmail
[Top] [All Lists]

Re: rule set problem

2002-10-24 18:25:58

On Thursday, Oct 24, 2002, at 18:35 Canada/Mountain, Tom Allison wrote:

Ruud H.G. van Tol wrote:
Tom Allison skribis:
Ruud H.G. van Tol:

Tom Allison:

* ^From.*$MYDOMAIN

 * $ ^^From[  ].*$MYDOMAIN

I ended up going with
* $ ^^From .*$MYDOMAIN

What I do not understand is what my regex was asking for that
prevented it from working.
The '$' in a regexp means end-of-line. Only when you add a dollar to the asterisk, the variables are recognized and expanded first.
BTW, the [  ] is a procmail-list-shorthand for [<space><tab>].
(a characterset with just 2 spaces inside is a strange thing)

While [ ] is a good idea in general in this case it is actually NOT. the From header in the first line is "From " and "From^I" is invalid.

Would it have been easier to just adopt the POSIX regex functions that are so common?
I am new, so I don't have the history, but it seems strange.

most times in a procmail recipe you don't need the compleities of regex. And it's much easier to say

* ^TO_sally

than

* ^TO_.*sally.*


_______________________________________________
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>