procmail
[Top] [All Lists]

Re: Matches as folders

1999-04-21 22:31:27
Philip Guenther suggested to Bek Oberin,

| Well, I would probably match the second line a match against MATCH itself:

Good idea, because it saves procmail the effort of scanning the whole head
for the second condition, but ...

|     :0:
|     * 
^From:(.*[^-a-z0-9_.])?\/[-a-z0-9_(_dot_)]+(_at_)netizen\(_dot_)com\(_dot_)au([^-a-z0-9_.]|$)
|     * MATCH ?? ^^\/[^(_at_)]+
|     netizen.$MATCH

I'm not sure when Stephen put in the fix ... the HISTORY file might say ...
but in the first few versions of procmail that had \/ and ??, that wouldn't
work, because the presence of \/ in the regexp would zero out the MATCH
variable, and you couldn't extract from the previous value of MATCH unless
you broke up the recipe and saved the intermediate value in another variable.
If Bek is using one of those versions and cannot upgrade, code like this is
necessary:

 :0
 * 
^From:(.*[^-a-z0-9_.])?\/[-a-z0-9_(_dot_)]+(_at_)netizen\(_dot_)com\(_dot_)au([^-a-z0-9_.]|$)
 {
  PRELIMMATCH=$MATCH

  :0:
  * PRELIMMATCH ?? ^^\/[^(_at_)]+
  netizen.$MATCH
 }

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