🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #155345

Re: [Xnews] Scoring x-posts

#155345
From: Murray Peterson
Date: Thu, 09 Sep 2004 18:43
44 lines
2757 bytes
me@tadyatam.invalid wrote in 
news:Xns955F881CC9AB7metadyataminvalid@netnews.worldnet.att.net:

> I'm trying to score posts to 'n' (5) groups, no more, no less.

You need to use something other than ".*", since that will eat all 
characters, including your colon.  e.g.  (.*:){1} will match "a:b:c:d:e", 
with the ".*" matching "a:b:c:d", still leaving one colon for the rest of 
the regexp.

To get exact counts, you need a regexp that won't go across the desired 
substring boundaries.  Something like "([^:]+:\d+)", which matches one or 
more "not colons", followed by a colon, followed by one or more digits.

You then need to anchor this repeated substring to the start and end of 
the entire string.  This forces the regexp to match the entire string, 
not just some portion of it.  Using the example of a:b:c:d:e, the regexp
"(.:){1}" will match, while "^(.:){1}$ will not.

One final note -- the xref field has been "munched" by Xnews before being 
scored, with the current group removed.  This means your counts will be 
off by one (Luu does warn you about this in the manual).

The score entry that will do what you want looks like this:

Score:: -4001
    	Xref: ^([^:]+:\d+){4}$



> (and "getting to know" regex).

Good luck -- perserverance and practice helps.

A common "gotchas" when scoring in Xnews:

Be careful when using single colons following the Score keyword -- the 
AND operator is not usually what you want when scoring, and can cause 
some grief if yuo aren't careful.

-- 
Murray Peterson
Email: murray_peterson@shaw.ca (remove underscore)
URL:   http://members.shaw.ca/murraypeterson/
Technical Details
Message-ID: <Xns955F8190DB64farkle@24.71.223.159>
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!number1.nntp.dca.giganews.com!internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!shaw.ca!pd7tw3no.POSTED!53ab2750!not-for-mail
References: <Xns955F72BBEC18metadyataminvalid@netnews.worldnet.att.net> <Xns955F6C957AB2Dfarkle@24.71.223.159> <Xns955F881CC9AB7metadyataminvalid@netnews.worldnet.att.net>

Show Full Headers
Complete Article Headers
Message-ID: <Xns955F8190DB64farkle@24.71.223.159>
Subject: Re: [Xnews] Scoring x-posts
Date: Thu, 09 Sep 2004 18:43:03 GMT
From: Murray Peterson <mwp@home.com.invalid>
References: <Xns955F72BBEC18metadyataminvalid@netnews.worldnet.att.net> <Xns955F6C957AB2Dfarkle@24.71.223.159> <Xns955F881CC9AB7metadyataminvalid@netnews.worldnet.att.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!number1.nntp.dca.giganews.com!internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!shaw.ca!pd7tw3no.POSTED!53ab2750!not-for-mail
X-Trace-PostClient-IP: 68.145.154.18
Newsgroups: news.software.readers
Organization: None
User-Agent: Xnews/06.02.16
Lines: 44
NNTP-Posting-Host: 24.71.223.147
X-Complaints-To: abuse@shaw.ca
X-Trace: pd7tw3no 1094755383 24.71.223.147 (Thu, 09 Sep 2004 12:43:03 MDT)
NNTP-Posting-Date: Thu, 09 Sep 2004 12:43:03 MDT