procmail
[Top] [All Lists]

Re: what's the subject of the thread about getting rid of the Re^# stuff

1997-08-10 02:58:00
On Sat,  9 Aug 97 22:35:57 +0200,
Ben Stuyts <benst(_at_)terminus(_dot_)stuyts(_dot_)nl> wrote:
:0 fhD
* ^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]: *\
     (RE:|re:|([rR][eE]: ?)*[rR][eE][[^]|[rR][eE]: *[rR][eE]:)

Why would one specify case significant matching, then list all
alternatives in both upper and lower case? And then proceed with a
Perl script which will translate a different set of cases? I also see
a bit of duplication in this regular expression. Try this instead. 

  :0fhw
  * ^Subject:[  ]*(re(^[][0-9^])?(:[     ]*)?)+re(^[][0-9^])?:[  ]*

| perl -pe 's/^subject:\s*(re[][^\d]*:\s*)+/Subject: Re: /i;'

Or run this unconditionally; it's a bit of a waste of resources, but
it spares you from having to maintain +almost+ the same regular
expression in the Perl script and in the Procmail condition. 

/* era */

Yes, this will maliciously do nasty things to Rere: and friends. And
yes, I should probably dig up the solutions that were posted last time
and refer to them instead. They're probably better than this.

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>