Article View: news.software.readers
Article #217491Re: [Leafnode] Filter for cigs?
From: Blinky the Shark
Date: Thu, 06 Mar 2008 20:04
Date: Thu, 06 Mar 2008 20:04
90 lines
4024 bytes
4024 bytes
Marshall Price wrote: > Peter J Ross wrote: >> 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! >> > > I don't get it. Comparing execute times: 0.0009 milliseconds - 0.0005 > milliseconds equals 0.0004 milliseconds (or 0.0000004 seconds, or 400 > nanoseconds). > > Granted, it's the principle that counts, and light can travel pretty far > in that amount of time, but how about the time spent studying the pcre > manual? > > You could get to Barnard's Star and back in that amount of time, and > though you'd be younger than your contemporaries the next time they saw > you, they'd probably tell you nobody uses a keyboard anymore, not to > mention perl! > > And they'd tell you by mental telepathy, so grammar, spelling, and > regular expressions wouldn't matter anymore either. > > <virtual name="smiley" content="wink" /> I see no need for the second "t" to be in the filter string, either. -- Blinky Killing all posts from Google Groups The Usenet Improvement Project: http://improve-usenet.org Blinky: http://blinkynet.net
Technical Details
Message-ID:
<pan.2008.03.06.20.04.12.13310@thurston.blinkynet.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!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mailReferences:
<20080205092408@ilium.andrews-corner.org> <20080205100839@usenet.piggo.com> <slrnfqfd9d.8jl.pjr@pjr.gotdns.org> <13t0d6s8de9b0f8@corp.supernews.com>Show Full Headers
Complete Article Headers
Message-ID: <pan.2008.03.06.20.04.12.13310@thurston.blinkynet.net> Subject: Re: [Leafnode] Filter for cigs? Date: Thu, 06 Mar 2008 12:04:13 -0800 From: Blinky the Shark <no.spam@box.invalid> References: <20080205092408@ilium.andrews-corner.org> <20080205100839@usenet.piggo.com> <slrnfqfd9d.8jl.pjr@pjr.gotdns.org> <13t0d6s8de9b0f8@corp.supernews.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!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Newsgroups: news.software.readers Organization: http://blinkynet.net http://improve-usenet.org Lines: 90 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: individual.net 7a/K+V2wQsmWIZXZD+Vkaw8p5EENfLOuD+qf9DGJQP+zjb38Vf Cancel-Lock: sha1:HfcJkce7KtXaogtJu0cZdg1qM4U= User-Agent: Pan/0.14.2.91 X-Face: Jb-wQ7r&vrN}~8MC5B09S4&.ieh!Q:Di/XN.xrd#CU%; )bPa`Hm^(,3o$n(s75[P+$F+Q^4~Owj`WzkBtZU/#gL2BvEBm/e=/1,R0}d@q@)E X-OS: Mandriva Linux 2006.0; kernel 2.6.12 X-WebTV-Stationery: Standard; BGColor=green; TextColor=green X-The-Usenet-Improvement-Project: http://improve-usenet.org