🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #216435

Re: [Leafnode] Filter for cigs?

#216435
From: Troy Piggins
Date: Tue, 05 Feb 2008 01:20
70 lines
3496 bytes
* Peter J Ross is quoted & my replies are inline below :
> In news.software.readers on Tue, 05 Feb 2008 10:15:47 +1000, Troy
> Piggins <usenet-0802@piggo.com> wrote:
>
>> * andrew is quoted & my replies are inline below :
>>> Hi,
>>>
>>> I am setting up a Leafnode-2 filter for the subject cigarettes as
>>> follows:
>>>
>>> newsgroups = .*
>>> pattern = ^Subject:.*[Cc]igarettes
>>> action = kill
>>>
>>> but this primitive filter has a few shortcomings in that it does not
>>> filter:
>>>
>>> 1. CIGARETTES
>>> 2. cigarett
>>> 3. cigarette
>>>
>>> All of which I have seen in various groups. Any thoughts?
>>
>> The pattern rule is a PCRE -> 'man pcre' and 'man pcrepattern' ;)
>> Off the top of my head:
>>
>>      pattern = ^Subject:.*(?i)cigarette?s?
>>
>> (untested)
>
> There's no point in checking for "e" and "s" if you're also going to
> filter lines that contain neither "e" nor "s". Your pattern does the
> sames as
>
> 	pattern = ^Subject:.*(?i)cigarett
>
> but takes a few microseconds longer to do it.
>
> #v+
> pjr@desktop:~$ pcretest -t
> PCRE version 7.4 2007-09-21
>
>   re> /(?i)cigarett/
> Compile time 0.0028 milliseconds
> data> buy cigarettes online
> Execute time 0.0005 milliseconds
>  0: cigarett
> data>
> pjr@desktop:~$ pcretest -t
> PCRE version 7.4 2007-09-21
>
>   re> /(?i)cigarette?s?/
> Compile time 0.0041 milliseconds
> data> buy cigarettes online
> Execute time 0.0009 milliseconds
>  0: cigarettes
> data>
> pjr@desktop:~$
> #v-
>
> That's 0.000014 seconds wasted!

You bastard!  I just wasted the equivalent of 1,071,428,571
pattern matches reading your post!  :D

-- 
Troy Piggins | http://piggo.com/~troy/slrn                    ___  |   __   __
* Currently using slrn pre0.9.9-82                           |___  | |/   |/  |
* Try it:                                                     ___| | |    |   |
$ svn co https://slrn.svn.sourceforge.net/svnroot/slrn/trunk slrn
Technical Details
Message-ID: <20080205111909@usenet.piggo.com>
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!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!news.motzarella.org!motzarella.org!not-for-mail
References: <20080205092408@ilium.andrews-corner.org> <20080205100839@usenet.piggo.com> <slrnfqfd9d.8jl.pjr@pjr.gotdns.org>

Show Full Headers
Complete Article Headers
Message-ID: <20080205111909@usenet.piggo.com>
Subject: Re: [Leafnode] Filter for cigs?
Date: Tue, 05 Feb 2008 11:20:31 +1000
From: Troy Piggins <usenet-0802@piggo.com>
References: <20080205092408@ilium.andrews-corner.org> <20080205100839@usenet.piggo.com> <slrnfqfd9d.8jl.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!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!news.motzarella.org!motzarella.org!not-for-mail
Newsgroups: news.software.readers
Organization: A noiseless patient Spider
Lines: 70
Reply-To: usenet-0802@piggo.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: feeder.motzarella.org
 U2FsdGVkX19za/TNT2pM48s93HjjeVs7C783ViG386UMa+sQ+ZaZvHCsAlfATH3d4sm8LZa8mGnVO7x30qX5bdu0DIXJxY0y9C1GdBwpP7IklxXEYvinMzaVD6BVg7AlxFpIZ2W0XR2eQKwt5hGFYA==
X-Complaints-To: Please send complaints to abuse@motzarella.org with full
 headers
NNTP-Posting-Date: Tue, 5 Feb 2008 01:40:02 +0000 (UTC)
X-Auth-Sender: U2FsdGVkX19qC0bJGdE+fiTuv8ffAhdFwnHEvTwsF24TwaCSdyFYAg==
X-NNTP-Proxy: Leafnode-2
 (http://www-dt.e-technik.uni-dortmund.de/~ma/leafnode/beta/)
Cancel-Lock: sha1:b/nZyl7HpD9pSD7iM6i8AKhKSQs=
User-Agent: slrn/pre0.9.9-82/rt (Linux)