Charlie Watts wrote:

>On Sat, 9 Mar 2002, Rob McMillin wrote:
>
>>Charlie Watts wrote:
>>
>>>The current SUBJ_ALL_CAPS is broken.
>>>
>>>(The one from CVS - this:
>>>header SUBJ_ALL_CAPS Subject =~ /^[^a-z]*([A-Z][^a-z]*){3,}[^a-z]*$/
>>>)
>>>
>>Congratulations, Charlie! You're the next winner on "The Regex Is Right!"
>>
>
>Thanks, Rob! What did I win?
>
><snip>
>
>>What's really wanted here is a multi-pass eval test, something like
>>
>>sub subject_is_all_caps
>>{
>>  my $subject = @_[0];
>>  $subject =~ s/[^a-zA-Z]//;
>>  return $subject cmp lc($subject);
>>}
>>
>>because now we can look at this and say that, for sure, anything left
>>over is a capital letter and the subject is indeed all caps. The
>>substitution is cheap compared to the expensive RE above.
>>
>
>I do -not- understand that routine's logic. You remove all non-letter
>characters, and then compare the remaining letters with their lowercased
>versions.
>
>That will return true for anything all lower-case, and false for anything
>with any subject with any upper-case characters.
>
>Or am I wrong? I'm confused. :-)
>
<sheepish>
s/b

 return $subject cmp uc($subject);

</sheepish>

-- 
          http://www.pricegrabber.com | Dog is my co-pilot.

                                   




_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to