🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
27 messages
27 total messages Started by andrew Mon, 04 Feb 2008 22:29
[Leafnode] Filter for cigs?
#216423
Author: andrew
Date: Mon, 04 Feb 2008 22:29
22 lines
1503 bytes
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?

    Andrew

-- 
http://www.andrews-corner.org
Re: [Leafnode] Filter for cigs?
#216425
Author: andrew
Date: Tue, 05 Feb 2008 00:08
21 lines
1652 bytes
On 2008-02-04, andrew <andrew@ilium.invalid> wrote:
> I am setting up a Leafnode-2 filter for the subject cigarettes as
> follows:
>
> newsgroups = .*
> pattern = ^Subject:.*[Cc]igarettes
> action = kill

Or the slightly improved version:

newsgroups = .*
pattern = ^Subject:.*[Cc][Ii][Gg][Aa][Rr][Ee][Tt].*
action = kill

which seems to catch upper and lower case 'cigaret' plus cigarett,
cigarette, cigarettes etc.
 
          Andrew

-- 
http://www.andrews-corner.org
Re: [Leafnode] Filter for cigs?
#216427
Author: Troy Piggins
Date: Tue, 05 Feb 2008 00:15
31 lines
2339 bytes
* 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)

-- 
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
Re: [Leafnode] Filter for cigs?
#216429
Author: Troy Piggins
Date: Tue, 05 Feb 2008 00:31
31 lines
2458 bytes
* andrew is quoted & my replies are inline below :
> On 2008-02-04, andrew <andrew@ilium.invalid> wrote:
>> I am setting up a Leafnode-2 filter for the subject cigarettes as
>> follows:
>>
>> newsgroups = .*
>> pattern = ^Subject:.*[Cc]igarettes
>> action = kill
>
> Or the slightly improved version:
>
> newsgroups = .*
> pattern = ^Subject:.*[Cc][Ii][Gg][Aa][Rr][Ee][Tt].*
> action = kill
>
> which seems to catch upper and lower case 'cigaret' plus cigarett,
> cigarette, cigarettes etc.

But it also matches:

     Subject: [slrn] how do I killfile "cigarettes" posts?

;)

See my other followup for caseless matching using (?i)

-- 
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
Re: [Leafnode] Filter for cigs?
#216430
Author: Peter J Ross
Date: Tue, 05 Feb 2008 00:38
53 lines
2510 bytes
In news.software.readers on Tue, 5 Feb 2008 09:29:40 +1100, andrew
<andrew@ilium.invalid> wrote:

> 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?

Try

	pattern = ^Subject:.*(?i)cigarett

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.

Leafnode fully supports PCRE, so you can use all the features
described in the manual:

	$ man 3 pcrepattern

Personally, I'd be inclined to do something like this:

	newsgroups = .*
	pattern = ^References:
	action = 2
	pattern = ^Subject:.*(?i)cigarett
	action = -1
	pattern = ^Subject:.*(?i)nike.*jordan
	action = -1
	# [etc.]

That will kill spam that doesn't have a References: line, but not
replies asking how to filter it.

-- 
PJR :-)
Re: [Leafnode] Filter for cigs?
#216431
Author: Peter J Ross
Date: Tue, 05 Feb 2008 01:00
63 lines
2774 bytes
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!

-- 
PJR :-)
Re: [Leafnode] Filter for cigs?
#216432
Author: »Q«
Date: Tue, 05 Feb 2008 01:06
12 lines
1485 bytes
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.
Re: [Leafnode] Filter for cigs?
#216435
Author: 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
Re: [Leafnode] Filter for cigs?
#216436
Author: Blinky the Shark
Date: Tue, 05 Feb 2008 02:04
25 lines
2050 bytes
»Q« 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.

Why are the word boundaries needed?

BUYCIGARETTES!!!11!!!!!!

-- 
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Blinky: http://blinkynet.net
Re: [Leafnode] Filter for cigs?
#216437
Author: Peter J Ross
Date: Tue, 05 Feb 2008 02:33
32 lines
2297 bytes
In news.software.readers on Mon, 04 Feb 2008 18:04:23 -0800, Blinky
the Shark <no.spam@box.invalid> wrote:

> »Q« 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.

And this kind of discussion is *fun*! (Well, I think so.)

> Why are the word boundaries needed?

I'm sure they aren't in this case.

> BUYCIGARETTES!!!11!!!!!!

	pattern = ^Subject:.*(?i)\b(buy)?cigarett(e|es|)\b

("!" is a non-word character.)

-- 
PJR :-)
Re: [Leafnode] Filter for cigs?
#216438
Author: 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 :-)
Re: [Leafnode] Filter for cigs?
#216439
Author: Ted S.
Date: Tue, 05 Feb 2008 03:46
17 lines
1954 bytes
On Mon, 04 Feb 2008 18:04:23 -0800, Blinky the Shark wrote:

>> I'd use (?i)\bcigarett(es?)?\b
>> 
>> It shouldn't make much difference, if any -- I'm just bored tonight.
> 
> Why are the word boundaries needed?

I wanted to kill posts about the drug Cialis, so I used {cialis} in my
Hamster regex.

It promptly killed a message with the word "specialist" in the subject
line.  Fortunately, the message was a spam.

-- 
Ted S.
fedya at bestweb dot net
Re: [Leafnode] Filter for cigs?
#216440
Author: Blinky the Shark
Date: Tue, 05 Feb 2008 04:02
40 lines
2588 bytes
Peter J Ross wrote:

> In news.software.readers on Mon, 04 Feb 2008 18:04:23 -0800, Blinky
> the Shark <no.spam@box.invalid> wrote:
> 
>> »Q« 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.
> 
> And this kind of discussion is *fun*! (Well, I think so.)
> 
>> Why are the word boundaries needed?
> 
> I'm sure they aren't in this case.
> 
>> BUYCIGARETTES!!!11!!!!!!
> 
> 	pattern = ^Subject:.*(?i)\b(buy)?cigarett(e|es|)\b

I'm thinking they're not in this case, either.  Without them, the last
(Q's) syntax woud've worked on that.


-- 
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Blinky: http://blinkynet.net
Re: [Leafnode] Filter for cigs?
#216441
Author: Blinky the Shark
Date: Tue, 05 Feb 2008 04:03
28 lines
2296 bytes
Ted S. wrote:

> On Mon, 04 Feb 2008 18:04:23 -0800, Blinky the Shark wrote:
> 
>>> I'd use (?i)\bcigarett(es?)?\b
>>> 
>>> It shouldn't make much difference, if any -- I'm just bored tonight.
>> 
>> Why are the word boundaries needed?
> 
> I wanted to kill posts about the drug Cialis, so I used {cialis} in my
> Hamster regex.
> 
> It promptly killed a message with the word "specialist" in the subject
> line.  Fortunately, the message was a spam.

How many words that a cigarette-filterer would NOT want to filter contain
the string  cigaret  ?

As for filtering, some people/cultures spell those things that way.


-- 
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Blinky: http://blinkynet.net
Re: [Leafnode] Filter for cigs?
#216443
Author: Ted S.
Date: Tue, 05 Feb 2008 04:22
23 lines
2470 bytes
On Mon, 04 Feb 2008 20:03:45 -0800, Blinky the Shark wrote:

>> I wanted to kill posts about the drug Cialis, so I used {cialis} in my
>> Hamster regex.
>> 
>> It promptly killed a message with the word "specialist" in the subject
>> line.  Fortunately, the message was a spam.
> 
> How many words that a cigarette-filterer would NOT want to filter
> contain the string  cigaret  ?

True, but it's not a bad habit to get into (unless you're worried about
those extra nanoseconds spent filtering the messages.)

There was also the time when I was getting a lot of spam with F|R|E|E
and the like in the subject, so I used the regex f.r.e.e -- which
promptly killed something with "for everybody" in it, and made me spend
more time trying to figure out why the message had been killed than I
had spent creating the original filter.  :-)

-- 
Ted S.
fedya at bestweb dot net
Re: [Leafnode] Filter for cigs?
#216446
Author: Blinky the Shark
Date: Tue, 05 Feb 2008 05:26
25 lines
2351 bytes
Ted S. wrote:

> On Mon, 04 Feb 2008 20:03:45 -0800, Blinky the Shark wrote:
> 
>>> I wanted to kill posts about the drug Cialis, so I used {cialis} in my
>>> Hamster regex.
>>> 
>>> It promptly killed a message with the word "specialist" in the subject
>>> line.  Fortunately, the message was a spam.
>> 
>> How many words that a cigarette-filterer would NOT want to filter
>> contain the string  cigaret  ?
> 
> True, but it's not a bad habit to get into (unless you're worried about
> those extra nanoseconds spent filtering the messages.)

Ted, at my age every nanosecond counts.  ;)


-- 
Blinky
Killing all posts from Google Groups
The Usenet Improvement Project: http://improve-usenet.org
Blinky: http://blinkynet.net
Re: [Leafnode] Filter for cigs?
#216450
Author: Peter J Ross
Date: Tue, 05 Feb 2008 06:07
53 lines
3037 bytes
In news.software.readers on Mon, 04 Feb 2008 20:02:31 -0800, Blinky
the Shark <no.spam@box.invalid> wrote:

> Peter J Ross wrote:
>
>> In news.software.readers on Mon, 04 Feb 2008 18:04:23 -0800, Blinky
>> the Shark <no.spam@box.invalid> wrote:
>> 
>>> »Q« 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.
>> 
>> And this kind of discussion is *fun*! (Well, I think so.)
>> 
>>> Why are the word boundaries needed?
>> 
>> I'm sure they aren't in this case.
>> 
>>> BUYCIGARETTES!!!11!!!!!!
>> 
>> 	pattern = ^Subject:.*(?i)\b(buy)?cigarett(e|es|)\b
>
> I'm thinking they're not in this case, either.

True, but there's no harm in giving examples of how to use the syntax
for use in cases when it's necessary.

> Without them, the last (Q's) syntax woud've worked on that.

It would also work in this form:

	pattern = ^Subject:.*(?i)\b(buy)?cigarett(es?)?\b

But there's probably absolutely nothing wrong with something like:

	pattern = ^Subject:.*(?i)cigarett

until somebody decides to write a newsreader called "scigaretto" or
something. :-)

-- 
PJR :-)
Re: [Leafnode] Filter for cigs?
#216506
Author: Gene E. Bloch
Date: Tue, 05 Feb 2008 23:19
63 lines
3625 bytes
On 2/04/2008, Peter J Ross posted this:
> In news.software.readers on Mon, 04 Feb 2008 20:02:31 -0800, Blinky
> the Shark <no.spam@box.invalid> wrote:
>
>> Peter J Ross wrote:
>> 
>>> In news.software.readers on Mon, 04 Feb 2008 18:04:23 -0800, Blinky
>>> the Shark <no.spam@box.invalid> wrote:
>>> 
>>>> »Q« 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.
>>> 
>>> And this kind of discussion is *fun*! (Well, I think so.)
>>> 
>>>> Why are the word boundaries needed?
>>> 
>>> I'm sure they aren't in this case.
>>> 
>>>> BUYCIGARETTES!!!11!!!!!!
>>> 
>>> 	pattern = ^Subject:.*(?i)\b(buy)?cigarett(e|es|)\b
>> 
>> I'm thinking they're not in this case, either.
>
> True, but there's no harm in giving examples of how to use the syntax
> for use in cases when it's necessary.
>
>> Without them, the last (Q's) syntax woud've worked on that.
>
> It would also work in this form:
>
> 	pattern = ^Subject:.*(?i)\b(buy)?cigarett(es?)?\b
>
> But there's probably absolutely nothing wrong with something like:
>
> 	pattern = ^Subject:.*(?i)cigarett
>
> until somebody decides to write a newsreader called "scigaretto" or
> something. :-)

To add very little to the whole discussion, or you could say, to take 
away very little :-), may I point out that some people spell the 
offending term "cigaret", as well as "cigarets" in the plural?

Not to mention cigareets and whuskey and wild, wild women.

-- 
Gene E. Bloch (Gino)   letters617blochg3251
(replace the numbers by "at" and "dotcom")

Re: [Leafnode] Filter for cigs?
#216675
Author: Adam Funk
Date: Sat, 09 Feb 2008 14:10
23 lines
1763 bytes
On 2008-02-05, Troy Piggins wrote:

>> newsgroups = .*
>> pattern = ^Subject:.*[Cc][Ii][Gg][Aa][Rr][Ee][Tt].*
>> action = kill
>>
>> which seems to catch upper and lower case 'cigaret' plus cigarett,
>> cigarette, cigarettes etc.
>
> But it also matches:
>
>      Subject: [slrn] how do I killfile "cigarettes" posts?
>
> ;)

Yabbut once you know the answer you don't need to read that thread!

;-)

-- 
Hi this is Leila. I'm not here right now. So please leave your name,
number and a brief message and a time you called at the beep. And
please try to be frank.                                   (Cox 1984)
Re: [Leafnode] Filter for cigs?
#217490
Author: Marshall Price
Date: Thu, 06 Mar 2008 18:15
83 lines
3431 bytes
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" />

-- 
Marshall Price of Miami
Known to Yahoo as d021317c
Re: [Leafnode] Filter for cigs?
#217491
Author: Blinky the Shark
Date: Thu, 06 Mar 2008 20:04
90 lines
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
Re: [Leafnode] Filter for cigs?
#217502
Author: »Q«
Date: Fri, 07 Mar 2008 00:18
11 lines
1615 bytes
Marshall Price <d021317c@yahoo.com> wrote:

> 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?

But time spent reading man pcre isn't /wasted/ time.  ;)
Re: [Leafnode] Filter for cigs?
#217516
Author: Marshall Price
Date: Fri, 07 Mar 2008 21:47
27 lines
2423 bytes
»Q« wrote:
> Marshall Price <d021317c@yahoo.com> wrote:
> 
>> 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?
> 
> But time spent reading man pcre isn't /wasted/ time.  ;)

You don't know me very well, unless you actually are Q, which I doubt.

(If you are, it's nice to meet you.  I'd love to tour the universe some 
day, but please don't hurt me.  I'm very sensitive about that, but of 
course you already know; I just hope you care.)

The thing is, I wouldn't actually *read* it; I'd just be gazing in its 
general direction and wondering from time to time what the heck it was 
all about and why did they choose such and such a word or leave out an 
extremely important comma -- a *mandatory* comma, by golly!

-- 
Marshall Price of Miami
Known to Yahoo as d021317c
Re: [Leafnode] Filter for cigs?
#217531
Author: Peter J Ross
Date: Sat, 08 Mar 2008 19:18
108 lines
4498 bytes
In news.software.readers on Thu, 06 Mar 2008 13:15:52 -0500, Marshall
Price <d021317c@yahoo.com> 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).

You're not including the difference in compile times. You may be right
not to do so, since execution happens far more frequently than
compilation.

> 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?

Fun is never a waste of time! Learning PCRE is the same kind of fun as
learning a foreign language.

> You could get to Barnard's Star and back in that amount of time,

I find the trip gets boring after a while, since the scenery never
changes much.

> 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!

What's a keyboard? I use telekinesis for everything nowadays (though
filling a fountain pen can be messy if I'm distracted).

> And they'd tell you by mental telepathy, so grammar, spelling, and 
> regular expressions wouldn't matter anymore either.

I still find regexes useful to keep my extensive telepathic killfile
organised. 

> <virtual name="smiley" content="wink" />

/me sends appropriate facial expression

-- 
PJR :-)

<http://pjr.lasnobberia.net/usenet/>
Re: [Leafnode] Filter for cigs?
#217533
Author: Adam Funk
Date: Sat, 08 Mar 2008 20:36
11 lines
1563 bytes
On 2008-03-08, Peter J Ross wrote:

> Fun is never a waste of time! Learning PCRE is the same kind of fun as
> learning a foreign language.

Hmm.  I've tried ordering drinks in PCRE but only with null results.


-- 
Two of the most famous products of Berkeley are LSD and Unix.
I don't think that this is a coincidence.         [anonymous]
Re: [Leafnode] Filter for cigs?
#217535
Author: Peter J Ross
Date: Sat, 08 Mar 2008 22:42
21 lines
2048 bytes
In news.software.readers on Sat, 8 Mar 2008 20:36:20 +0000, Adam Funk
<a24061@ducksburg.com> wrote:

> On 2008-03-08, Peter J Ross wrote:
>
>> Fun is never a waste of time! Learning PCRE is the same kind of fun as
>> learning a foreign language.
>
> Hmm.  I've tried ordering drinks in PCRE but only with null results.

/
A pint of your best (Wadworths 6X|Old Peculier|Abbot's Ale|London Pride),
please, landlord!
Mmm, this \1 is delicious! Another pint of \1, please!
/


-- 
PJR :-)

<http://pjr.lasnobberia.net/usenet/>
Re: [Leafnode] Filter for cigs?
#217597
Author: Adam Funk
Date: Mon, 10 Mar 2008 09:31
21 lines
1988 bytes
On 2008-03-08, Peter J Ross wrote:

>>> Fun is never a waste of time! Learning PCRE is the same kind of fun as
>>> learning a foreign language.
>>
>> Hmm.  I've tried ordering drinks in PCRE but only with null results.
>
> /
> A pint of your best (Wadworths 6X|Old Peculier|Abbot's Ale|London Pride),
> please, landlord!
> Mmm, this \1 is delicious! Another pint of \1, please!
> /

You must frequent the geekier^W better class of pubs.


-- 
I spend almost as time figuring out what's wrong with my computer as 
I do actually using it.  Networked software, especially, requires
frequent updates and maintenance, all of which gets in the way of
doing routine work.                                     (Stoll 1995)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads