Article View: news.software.readers
Article #199355Re: [XNews] A question: How to filter?
From: Peter J Ross
Date: Fri, 11 May 2007 13:25
Date: Fri, 11 May 2007 13:25
70 lines
2977 bytes
2977 bytes
In news.software.readers on 09 May 2007 16:49:27 GMT, TheWanderer
<eric_t2006-usenet@NOSPAMyahoo.com> wrote:
> Q: How does one set up a filter that can kill any article with a
> particular word in the subject? Say that I simply want any
> article with the word "casino", for instance, to simply go away?
Score: =-9999
Subject: casino
> Can you include multiple words per filter, or would one separate
> filter per term work better?
Score: =-9999
Subject: casino|lottery|bingo
Score:: =-9999
Subject: casino
Subject: lottery
Subject: bingo
Score: =-9999
Subject: casino
Score: =-9999
Subject: lottery
Score: =-9999
Subject: bingo
These three should all work exactly the same way.
> Can the filter, if it exists, of course, be used to screen
> "partial" terms, like "[filename].mpg"?
Usually, the expression in the filter will match part of a word *or* a
whole word, so you'd use
Subject: \.mpg
(where "\." matches the dot; "." would match any character).
If you wanted to match only whole words, you'd use "\b" to match word
boundaries. Examples:
Subject: fred
% matches the words fred, alfred and frederick
Subject: \bfred
% matches fred and frederick, but not alfred
Subject: fred\b
% matches fred and alfred, but not frederick
Subject: \bfred\b
% matches only fred
Subject: casino\b
% matches casino but not casinos
And finally, a rather advanced one to catch plurals and misspellings,
which some study of the XNews documentation should explain:
Subject: \b(casino(s|es)?|lot{1,2}er(y|ies)|bingo)\b
% matches the words casino, casinos, casinoes, lottery,
% lotteries, lotery, loteries and bingo, and nothing else.
You can match all the words in separate rules if you find it easier,
but after learning how to walk, learning how to run can be fun too.
--
PJR :-)
Technical Details
Message-ID:
<slrnf48rmc.3db.pjr@pjr.gotdns.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!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!mauve.octanews.net!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mailReferences:
<Xns992B7A2FA1AC4erictzoneabpeg@216.151.153.66>Show Full Headers
Complete Article Headers
Message-ID: <slrnf48rmc.3db.pjr@pjr.gotdns.org> Subject: Re: [XNews] A question: How to filter? Date: Fri, 11 May 2007 13:25:41 +0000 From: Peter J Ross <pjr@example.invalid> References: <Xns992B7A2FA1AC4erictzoneabpeg@216.151.153.66> 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!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!mauve.octanews.net!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail Newsgroups: news.software.readers Reply-To: pjr.spam@gmail.com User-Agent: slrn/0.9.8.1pl2 (Debian) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 70 Organization: Read Free News NNTP-Posting-Date: 11 May 2007 08:25:41 CDT X-Trace: DXC=lE76dVEV]EM7d=7eH37H<B]AGWjF5PjPI465Ue@WB_5OaZ=_4I]LGRN26Z<EbT:a\ElV3mi\haFgH3V78HOHRTYOD?j@aPg\jPA