procmail
[Top] [All Lists]

Re: ^Subject:.*xyz or SUB ?? xyz

1997-09-26 11:44:17
rik(_at_)netcom(_dot_)com (Rik Kabel) writes:
Assume that the content of a header (for the sake of example,
Subject) has been saved in the variable (again for example,
SUB) as follows:

    :0
    * ^Subject:[      ]+\/[^  ].*
    { SUB=$MATCH }

What reasons might there be to prefer one over the other of the
following alternative recipes?

    :0:  # Alternative construction 1
    * ^Subject:.*xyz
    fileit

    :0:  # Alternative construction 2
    * SUB ?? xyz
    fileit

The latter will be faster.


Would the answer be different for the following alternatives?

    :0: # Alternative construction 3
    * ^Subject:[      ]+xyz$
    fileit

    :0: # Alternative construction 4
    * SUB ?? ^^xyz^^
    fileit

No.  Given that you've already spent the cycles to locate and extract
the Subject: header, it really doesn't matter what regexp you search
for -- procmail's regexp engine will have less to scan through.


Philip Guenther

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