procmail
[Top] [All Lists]

Re: Matching the first occurrence of a header field

2002-04-07 12:15:28
=?iso-8859-1?Q?Jos=E9?= Romildo Malaquias 
<romildo(_at_)uber(_dot_)com(_dot_)br> writes:
...
And what about if I want to look only at the _second_ occurrence
of the Received: header? Is it possible? How?

        :0
        * ^Received:.*(^.*)*\/Received:.*
        { sec_received = $MATCH }

        :0 flags
        * sec_received ?? regexp


(To those familiar with normal regexps, that may look like it would
extract the _last_ Received: header field.  Nope: since the (^.*)* is
before the \/ token, procmail does _minimal_ matching on it, not the
standard 'greedy' matching.)


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