🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #242882

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

#242882
From: Gene E. Bloch
Date: Fri, 01 Oct 2010 00:03
83 lines
4563 bytes
On Thu, 30 Sep 2010 18:31:40 -0400, Mike Yetto wrote:

> 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

Meantime, what I wrote isn't even what I should've written :-)

I'm assuming that the OP wants to find x characters that are uppercase,
but which might or might not be contiguous. 

Given that, the plus sign I used should be a * or dot (as said above, I
don't recall what xnews uses), to indicate 0 or more non-uppercase
characters. 

If xnews allows it, maybe there's a way to indicate x instances of my
regex, like (regex)12, when x is 12, instead of writing it 12 times.

If my assumption is not what the drive-by OP wanted, all bets are off.

Gene "not necessarily one to gamble" Bloch

-- 
Gene E. Bloch (Stumbling Bloch)
Technical Details
Message-ID: <eby8yvz4ebfg$.12vrytnc6gfn6$.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!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!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> <slrn20100930182657.380.twooffive@may.eternal-september.org>

Show Full Headers
Complete Article Headers
Message-ID: <eby8yvz4ebfg$.12vrytnc6gfn6$.dlg@40tude.net>
Subject: Re: [Xnews] Looking for regex help - 20 CAPITAL letters in subject header?
Date: Thu, 30 Sep 2010 17:03:30 -0700
From: "Gene E. Bloch" <not-me@other.invalid>
References: <Xns9E0350120FCD5bookwight@207.246.207.159> <Xns9E03730466944VeebleFetzer@216.250.188.141> <slrn20100930130743.632.twooffive@may.eternal-september.org> <hzp2g19rrxa3$.1qs9z2e0o64o9.dlg@40tude.net> <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!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!not-for-mail
Newsgroups: news.software.readers
Organization: Astrolabe
Lines: 83
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.albasani.net
 7XhXlelIeKCqYET0LC4WLSmqmWgwPPjQgp0kIDSdo3W1+iDK5INEyln6PUnEvS+pKLzas0vt7NxcoyHDTJQ2KQ==
NNTP-Posting-Date: Fri, 1 Oct 2010 00:03:31 +0000 (UTC)
Cancel-Lock: sha1:l1/r1HWBPDnP19XVXQZWjcAE84Y=
User-Agent: 40tude_Dialog/2.0.15.84
Injection-Info: news.albasani.net;
 logging-data="EREfaA7dKlb/N8Zf5Kp9PuGwTfkrPki7Re811fFRtQA4aG3uTvC+ge5e98AghlO9wpQBaVrz1Fy7Jqmwpj+n20KvCH3nIIVv3zFnr6heqN+eM1GfvBARWYhnAs9kRfFS";
 mail-complaints-to="abuse@albasani.net"