procmail
[Top] [All Lists]

Re: Scoring for Capitals in the Subject line

2005-04-16 09:59:25
On 4/16/05, John Muggleton <john(_at_)mugsy(_dot_)org> wrote:

:0D
* -3^1 ^Subject:[a-z]
* 4^1 ^Subject:[A-Z]

which is supposed to capture 75% capitalisation

Ah, no.  That will capture the case where, of the headers labeled
"Subject:", at least one more has a value beginning with a capital
letter than has a value beginning with a lower case letter, assuming
none of them has a space after the colon.

What you want is to first extract the value of the single header
labeled "Subject:" and then examine only that value for lower or upper
case letters.  To turn it into "75%" rather than just "more capitals
than not" you also have to take into account the total number of both
kinds of letter.

:0
* ^Subject:\/.*
{
 :0D
 * -1^1 MATCH ?? [a-zA-Z]
 * -3^1 MATCH ?? [a-z]
 *  4^1 MATCH ?? [A-Z]
 { SEVENTYFIVEPCTCAPS=yes }
}


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail