procmail
[Top] [All Lists]

Re: strlen() in procmail

2003-01-15 13:05:57
| Yes, that's part of what I was worried about, better phrased.  Procmail
| normally matches minimally to the left of \/ and maximally to the right
| of it, but when it appears inside parens it's not clear what counts as
| "left" and "right".  Empirically, the entire parenthesized expression is
| matched minimally before considering the \/ subexpression.

Bart, I think it's more the case that procmail found the first match and then,
had it been the alternative that included the extractor, would have extracted.
But the first match it found was the alternative without the extractor (namely
a null string).

| However, that gave me the clue I needed to come up with this:
|
| * (^In-Reply-To:[^<]+<\/[^>]+|^^(.|$)*^^)

You probably don't need that outermost pair of parentheses.

| The "extraneous" anchoring in ^^(.|$)*^^ forces a scan of the full header,
| during which the subexpression I actually care about matches before
| reaching the end, and MATCH gets set properly.

So procmail will pick the alternative that ends first over the one that begins
first?  That's something I wouldn't have expected.  Thanks for the research.

David


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