🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #242877

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

#242877
From: Gene E. Bloch
Date: Thu, 30 Sep 2010 19:01
52 lines
3055 bytes
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.

-- 
Gene E. Bloch (Stumbling Bloch)
Technical Details
Message-ID: <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!nntp.giganews.com!weretis.net!feeder4.news.weretis.net!news.albasani.net!not-for-mail
References: <Xns9E0350120FCD5bookwight@207.246.207.159> <Xns9E03730466944VeebleFetzer@216.250.188.141> <slrn20100930130743.632.twooffive@may.eternal-september.org>

Show Full Headers
Complete Article Headers
Message-ID: <hzp2g19rrxa3$.1qs9z2e0o64o9.dlg@40tude.net>
Subject: Re: [Xnews] Looking for regex help - 20 CAPITAL letters in subject header?
Date: Thu, 30 Sep 2010 12:01:40 -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>
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!nntp.giganews.com!weretis.net!feeder4.news.weretis.net!news.albasani.net!not-for-mail
Newsgroups: news.software.readers
Organization: Astrolabe
Lines: 52
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.albasani.net
 6u3zlJUuZI9zb++mjobwXHDb+hx9DKyD+IbFa+vRyrm12B+WqJf3y+735ukYNNZ+82tb1xF4vnik5/EJivg0NjDeJL2QcxVSDOMEy22Vv2t+BCknqcGyyXuE0Wc3S1J4
NNTP-Posting-Date: Thu, 30 Sep 2010 19:01:41 +0000 (UTC)
Cancel-Lock: sha1:2J9jnVXhfwfmHpa++XZ9cOsCnBY=
User-Agent: 40tude_Dialog/2.0.15.84
Injection-Info: news.albasani.net;
 logging-data="D8Lntzbcm0lsHYb7s2ukS9LL3AxBvK2YO1jLkh9DWmE+nJkJqvo+ftXU85Mb+KY83xuLc5BJ07oBNxGMvAEwo6+WWWZ4bVboSlGxqHCtSMskjgwkLIzVYe25+al6js6z";
 mail-complaints-to="abuse@albasani.net"