procmail
[Top] [All Lists]

Re: vacation response

2000-04-23 13:29:18
From: dattier(_at_)ripco(_dot_)com (David W. Tamkin)

Dallman [intoned]:

= Still like to know what was wrong with my final suggestion, if
= anything:

=     * ! ^(X?|Mailing)-?[a-z-]*List[a-z:-]+

= Although it would match somewhat more than was stated in the
= interest of the single line, I don't find it overly course,
= especially when compared with the couple of .* phrases that the
= originals had.

I didn't comment on that because I couldn't concentrate enough to
reach an opinion on it when you first presented it.  I still can't.

<lol!>  Ha!  Thanks for that.  I feel relieved, as I'd thought it must
have been too stupid to rate a comment.  :-)

I'll admit that, much closer to the end of my day as it is now, it's
harder for me to look at than it was late this morning (Central
European Time) when I wrote it.  But I'll try.  What had been written
was:

* !^List-
* !^Mailing-List:

* !^X-.*-List:

* !^X-Listprocessor-Version:

So after the * !, we could construct it as starting with either an "X"
or the word "Mailing" or the word "List" as the first constituent.
The first element in my phrase, which element can be said to be
"(X?|Mailing)", takes care of the first two.  The question-mark, which
literally says the "X" may occur exactly zero or one time, allows us to
start to intimate the third possibility (i.e., that the first word can
be "List") if we presume zero instances of "X".

Now comes the (first) hyphen, or at least a possible one.  If we'd
gone with either an "X" or "Mailing" already before, we'll use the
hyphen here the optional one time permitted by my "-?" phrasing. 
If, otoh, we're still after beginning with "List", though, we'll
revert to the other option of zero hyphens so far.


Now we're up to "[a-z-]*", which text (if any) can include hyphens but
not colons.  Again, if we'd gone with "X" or "Mailing" to start, and
accepted the alternative of an extant first hyphen, we'll now need
either some (_cf._ third original phrase) or no (_cf._ second or fourth
original phrase) non-whitespace text *before the word "List"* (which
string I purposely made a requisite literal phrasal component in the
*following* atomic part, in order to reduce the "scatter effect" on
possible matches from the otherwise-broad "[a-z-]*"). <whew!>

If, otoh, we still await a "List" to start, as shown in the first
original phrase, the "*" at the end allows us to so far have exactly no
text.

Now comes (or, in the instance of the first original, "here" comes)
the word "List".  As we know, it will have necessarily occured somewhere
in all four phrases.

We're now up to the end of mine: "[a-z:-]+"  And, to recap, in the
original four phrases, we're at the end of the word "List".  In 
Original No. 1, all that's left is a hyphen (followed, one may
intimate, by more non-whitespace alphabet soup, but which must allow
for more hyphens; and, eventually, a colon).  In Original No. 2,
all that's left is the final colon.  Ditto Original No. 3.  In
Original Four, we have an explicit instance of what we only intimated
in One: more non-whitespace alphabet stuff and hyphens follow, ending,
finally, with a colon.  *Something*, however, is sure to follow in
each of the four original instances, even if only a colon.  The
"[a-z:-]+" handily dispatches with all of these possibilities. 

Since we never allowed for whitespace, we're not ever going to overrun
the colon that necessarily ends the header titles we're matching.
This is important as a defense to possible objections to my phrasing
that the original questioner just send me in email while I was finishing
the previous paragraph. :-)

QED: End.

In my mind, when creating the phrase I tested it backwards, looking to
see if each of the four phrases in the original would be covered; and
my reading of it was that they would be.

-- 
    \     .-.     .-.     .-.     .-.     .-.     .-.     .-.     /
     \-d-/-m-\-a-/-n-\-(_at_)-/-n-\-e-/-t-\-c-/-o-\-m-/-.-\-c-/-o-\-m-/
      '-'     '-'     '-'     '-'     '-'     '-'     '-'     '-'

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