🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #242881

Re: [Xnews] Looking for regex help - 20 CAPITAL letters in subject header?

#242881
From: Mike Yetto
Date: Thu, 30 Sep 2010 22:31
65 lines
3732 bytes
Gene E. Bloch <not-me@other.invalid> writes and having writ moves on.
>On Thu, 30 Sep 2010 13:13:54 -0400, Mike Yetto wrote:

>> Bert Hyman <bert@iphouse.com> writes and having writ moves on.
>>>In news:Xns9E0350120FCD5bookwight@207.246.207.159 BookWight
>>><Bookwight@publicspam.com> wrote: 
>> 
>>>> Hi -
>>>> 
>>>> I need help; I'm trying to filter out the subject headers which have
>>>> 'x' amount of capital letters in the subject.
>>>> 
>>>> All helpful suggestions welcome
>> 
>>>If there are no spaces, reading TFM suggests this:
>> 
>>>[A-Z]{x}
>> 
>>>If there are spaces or other characters, things get more complicated.
>> 
>>>See the section "Regular expression", "3) Quantifiers (match how many
>>>times)" 
>> 
>> A simpler approach would be to look for at least one lower-case
>> character.  To do this you need to set the regex to case
>> sensitive with an = sign.  Then look for [a-z] and negate the
>> expression.
>> 
>> #v+
>> [*]
>> Score:: -9999
>>   ~Subject:= [a-z]
>> #v-
>> 
>> Or you can look for a minimum number of lower-case characters
>> greater than one with the {n} construct.
>> 
>> Mike "answer too hard? change the question" Yetto

>As I read it, that's not quite what he asked.

>I would say he needs a way to count UC letters, and score it if the
>number is x or more. Or exactly x; he was possibly ambiguous...

>All I can think of is start with Subject:=[A-Z][~A-Z]+
>and concatenate enough such selectors (*both* sets of brackets) to the
>above to make x of them.

>I don't have xnews handy, so I'm guessing about the syntax. I mean
>[~A-Z]+ to stand for 1 or more characters that aren't UC letters.

I assumed the OP wanted to score on shouted subject lines as this
is a hallmark of spam.  If the requirement is a specific or
minimum number of upper case characters we'll need some more
information.

Should the UC characters be contiguous?  Can they be separated by
whitespace?  If so, do the whitespace characters count?  If they
can be interspersed with lower case characters or numbers this
could get very tricky.

Mike "awaiting the new specs" Yetto
-- 
In theory, theory and practice are the same.
In practice they are not.
Technical Details
Message-ID: <slrn20100930182657.380.twooffive@may.eternal-september.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
References: <Xns9E0350120FCD5bookwight@207.246.207.159> <Xns9E03730466944VeebleFetzer@216.250.188.141> <slrn20100930130743.632.twooffive@may.eternal-september.org> <hzp2g19rrxa3$.1qs9z2e0o64o9.dlg@40tude.net>

Show Full Headers
Complete Article Headers
Message-ID: <slrn20100930182657.380.twooffive@may.eternal-september.org>
Subject: Re: [Xnews] Looking for regex help - 20 CAPITAL letters in subject header?
Date: Thu, 30 Sep 2010 18:31:40 -0400
From: Mike Yetto <myetto1@nycap.invalid>
References: <Xns9E0350120FCD5bookwight@207.246.207.159> <Xns9E03730466944VeebleFetzer@216.250.188.141> <slrn20100930130743.632.twooffive@may.eternal-september.org> <hzp2g19rrxa3$.1qs9z2e0o64o9.dlg@40tude.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
Newsgroups: news.software.readers
Organization: slrn Mafia / Xnews Tong (emeritus)
Lines: 65
Injection-Date: Thu, 30 Sep 2010 22:36:04 +0000 (UTC)
Injection-Info: may.eternal-september.org;
 posting-host="LagJXPyKy0Sy/aUTUT+6gw";
 logging-data="2478"; mail-complaints-to="abuse@eternal-september.org";
 posting-account="U2FsdGVkX1+am0ng8jhGXVgP4jDYICRL8s+616kGP40="
User-Agent: slrn/pre1.0.0-24/co (Kubuntu 10.04; 64bit)
X-The-Usenet-Improvement-Project: http://twovoyagers.com/improve-usenet.org/
X-No-Bananas: Yes
Cancel-Lock: sha1:KSWy9deB3UTEFoWiTKNF5gTOFl8=