procmail
[Top] [All Lists]

Re: Messed Up Subject Line??? Help

1996-12-11 13:14:18
On Wed, 11 Dec 1996 11:43:17 -0800 (PST), Chin Fang
<fangchin(_at_)jessica(_dot_)Stanford(_dot_)EDU> wrote:
* ^Subject:(.*\<)?PEN(\>|$)
This will trash mail with the subject having the word PEN, only as a
separate word, and only in uppercase.
If so, why the ? in the (.*\<)? is necessary?  Also, the above man

The question mark makes the whole paren conditional. That is, an
arbitrary string ending in a \< character, or nothing at all. 

Similarly, the second paren says, "[any string beginning with] a word
boundary, or else an immediate end of line ($)".

It bears pointing out that Procmail's notion of \< and \> is less
generic than egrep's, which actually matches these on the empty string
at the boundary of a word. Procmail's boundary matches only match on
actual characters, i.e. foo\> doesn't match a foo at the very end of a
line. Use foo(\>|$) as demonstrated above for that. 

Hope this helps,

/* era */

-- 
See <http://www.ling.helsinki.fi/~reriksso/> for mantra, disclaimer, etc.
* If you enjoy getting spam, I'd appreciate it if you'd register yourself
  at the following URL:  <http://www.ling.helsinki.fi/~reriksso/spam.html>

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