๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #216438

Re: [Leafnode] Filter for cigs?

#216438
From: Peter J Ross
Date: Tue, 05 Feb 2008 03:06
28 lines
2320 bytes
In news.software.readers on Mon, 4 Feb 2008 19:06:40 -0600, ยปQยซ
<boxcars@gmx.net> wrote:

> Peter J Ross <pjr@example.invalid> wrote:
>
>> or, more elaborately and probably unnecessarily so:
>> 
>> 	pattern = ^Subject:.*(?i)\bcigarett(e|es|)\b
>> 
>> "(?i)" makes whatever follows case-insensitive. "\b" matches a word
>> boundary. "(e|es|)" matches "e", "es" or nothing.
>
> I'd use (?i)\bcigarett(es?)?\b
>
> It shouldn't make much difference, if any -- I'm just bored tonight.

Your version is faster to compile but slower to execute.

Both versions ought to execute faster if the quantifiers are made
non-greedy, either by changing "*" and "?" to "*?" and "??" or by
prepending "(?U)" to the pattern.

With very complex patterns in the Leafnode filter file, such
optimizations could easily save up to a second a day, and are
therefore obviously worth spending hours discussing. :-)

-- 
PJR :-)
Technical Details
Message-ID: <slrnfqfkku.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!feeder.news-service.com!news.motzarella.org!motzarella.org!not-for-mail
References: <20080205092408@ilium.andrews-corner.org> <slrnfqfc11.8jl.pjr@pjr.gotdns.org> <20080204190640.58fe3f7c@bellgrove.remarqs.net>

Show Full Headers
Complete Article Headers
Message-ID: <slrnfqfkku.8jl.pjr@pjr.gotdns.org>
Subject: Re: [Leafnode] Filter for cigs?
Date: Tue, 05 Feb 2008 03:06:06 +0000
From: Peter J Ross <pjr@example.invalid>
References: <20080205092408@ilium.andrews-corner.org> <slrnfqfc11.8jl.pjr@pjr.gotdns.org> <20080204190640.58fe3f7c@bellgrove.remarqs.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!feeder.news-service.com!news.motzarella.org!motzarella.org!not-for-mail
Newsgroups: news.software.readers
Organization: none
Lines: 28
Reply-To: Peter J Ross <pjr.spam@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: feeder.motzarella.org
 U2FsdGVkX1+cIz460wRTdsTAQ6NwjjI6goVGcMkCvLmvBHjjeb1XatJ55heaOB4yRGEg50Zhn2lI9EtRbzpR3dk97l3AjArMOJaR/MKp10iecH4lMFkKsc+bN7JQzNPjJGnq6FtP5r8=
X-Complaints-To: Please send complaints to abuse@motzarella.org with full
 headers
NNTP-Posting-Date: Tue, 5 Feb 2008 03:10:05 +0000 (UTC)
X-Auth-Sender: U2FsdGVkX1/oo9ryJKNUTaUPVJjmvbim
Cancel-Lock: sha1:TItBVm8dF4W0bft4tAcpURM1riw=
User-Agent: slrn/pre0.9.9-82 (Linux)