🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
23 messages
23 total messages Started by Sam Lowry Sun, 10 Sep 2006 10:45
[Pan] filter help
#190545
Author: Sam Lowry
Date: Sun, 10 Sep 2006 10:45
15 lines
1752 bytes
Hi

I've subbed to N.S.R and am trying to filter out everything I'm
not interested in (could do this fine with Dialog while I was using
windoze).

In the Edit Filter window I have "Subject does not contain pan" and in the
edit rule window I have selected "Ignore thread" but I still have loads of
threads without pan in the subject.

What am I doing wrong?

-SL
Re: [Pan] filter help
#190547
Author: Mike Dee
Date: Sun, 10 Sep 2006 13:19
66 lines
3759 bytes
On Sun, 10 Sep 2006 11:45:21 +0100, Sam Lowry wrote:

> I've subbed to N.S.R and am trying to filter out everything I'm
> not interested in (could do this fine with Dialog while I was using
> windoze).
> 
> In the Edit Filter window I have "Subject does not contain pan" and in the
> edit rule window I have selected "Ignore thread" but I still have loads of
> threads without pan in the subject.
> 
> What am I doing wrong?

You should be using a score file.

If you haven't yet created a score file, creating (a plain text file)
named "score" somewhere in your path will do, (a folder named Pan in your
home directory would be ideal for storing this)

Using a plain text editor, start a new text file. Enter into it:

[*]

And for now, save your text file, naming it "score".

Any new scores you enter under the above will work in all newsgroups, but
for newsgroup specific scores, such as NSR you create separate headings.

So, in Pan, now go to the "Edit" menu and choose "Preferences". In the
dialog that appears, click the "Apps & Mail" tab. Next to the heading
"Scorefile Editor" is a pull-down field with a list of possible editors,
click down on this to choose one if you don't like the default (gedit is
nice if it's there). Below this is another field for the "Scorefile",
click the "browse" button to navigate to where you saved the "score" file
to earlier. Select it's name and choose OK. Close the Preferences dialog.

Go to "Tools" menu and choose "Edit Scorefile". The file "score" will now
reopen in the text editor you chose in Preferences.

And the score you are wanting, for filtering out all posts other than
posts about Pan goes like this:

[^news\.software\.readers$]
     Score:  =-9999
        ~Subject: \[?pan\]?$

The above score will work very well, *but* topical traffic about Pan in
NSR is very sparse to say the least... And because Pan bases it's
method of scoring on PCRE, pinched directly from SLRN, you will be missing
out on possible scoring tips when that news client is being discussed, and
the same goes for Xnews which also uses the same scoring methods.

If I were to be inclined to limit the posts in NSR to certain clients I
would probably change the above score to something like this, for example:

[^news\.software\.readers$]
     Score:  =-9999
        ~Subject: \[?pan\]?$|slrn|xnews

Note: Because Pan has such lousy user help, you will have to look
elsewhere for help on effective scoring using PCRE. Here's a good starting
point (SLRN):

http://slrn.sourceforge.net/manual/slrn-FAQ-4.html

-- 
dee
Re: [Pan] filter help
#190548
Author: Mike Dee
Date: Sun, 10 Sep 2006 15:49
19 lines
1645 bytes
On Sun, 10 Sep 2006 23:19:12 +1000, Mike Dee wrote:

> [^news\.software\.readers$]
>      Score:  =-9999
>         ~Subject: \[?pan\]?$
> 

Oops. Get that "$" out of the Subject line here. Bad idea. Better if it
looks more like this.

 [^news\.software\.readers$]
     Score:  =-9999
        ~Subject: \b\[?pan\]?\b

(\b will prevent scoring on 'span' or 'panic', etc - $ signifies 'end of
string').

-- 
dee
Re: [Pan] filter help
#190549
Author: Blinky the Shark
Date: Sun, 10 Sep 2006 19:26
25 lines
1824 bytes
Mike Dee wrote:
> On Sun, 10 Sep 2006 23:19:12 +1000, Mike Dee wrote:
>
>> [^news\.software\.readers$]
>>      Score:  =-9999
>>         ~Subject: \[?pan\]?$
>> 
>
> Oops. Get that "$" out of the Subject line here. Bad idea. Better if it
> looks more like this.
>
>  [^news\.software\.readers$]
>      Score:  =-9999
>         ~Subject: \b\[?pan\]?\b
>
> (\b will prevent scoring on 'span' or 'panic', etc - $ signifies 'end of
> string').

Does the question mark mean "next character not case sensitive"?


-- 
Blinky                                                   RLU 297263 
Killing all posts from Google Groups
The Usenet Improvement Project: http://blinkynet.net/comp/uip5.html
Re: [Pan] filter help
#190566
Author: Peter J Ross
Date: Mon, 11 Sep 2006 09:24
20 lines
1696 bytes
On 10 Sep 2006 19:26:52 GMT, Blinky the Shark <no.spam@box.invalid>
wrote in news.software.readers:

> Mike Dee wrote:
>>         ~Subject: \b\[?pan\]?\b
>
> Does the question mark mean "next character not case sensitive"?

No. Regexes in pan aren't case-sensitive. The ? means 0 or 1
occurences of the previous character. So the regex matches "pan",
"Pan" and "PAN"; and "[pan]", "[Pan]" and "[PAN]"; but not "[[pan]]"
etc.

PJR :-)
-- 
  _  _(o)_(o)_  _     | The fool hath said in his heart, "There is no Cabal."
._\`:_ F S M _:' \_,  | FSM: <http://www.venganza.org/>
    / (`---'\ `-.     | AUK: <http://www.netcabal.com/auk/>
 ,-`  _)    (_,   F_P | PJR: <http://insurgent.org/~pjr/>
Re: [Pan] filter help
#190569
Author: Blinky the Shark
Date: Mon, 11 Sep 2006 16:19
20 lines
1983 bytes
Peter J Ross wrote:
> On 10 Sep 2006 19:26:52 GMT, Blinky the Shark <no.spam@box.invalid>
> wrote in news.software.readers:
>
>> Mike Dee wrote:
>>>         ~Subject: \b\[?pan\]?\b
>>
>> Does the question mark mean "next character not case sensitive"?
>
> No. Regexes in pan aren't case-sensitive. The ? means 0 or 1
> occurences of the previous character. So the regex matches "pan",
> "Pan" and "PAN"; and "[pan]", "[Pan]" and "[PAN]"; but not "[[pan]]"
> etc.

I shoulda known that.  Duh.  :)

-- 
Blinky                                                   RLU 297263 
Killing all posts from Google Groups
The Usenet Improvement Project: http://blinkynet.net/comp/uip5.html
Re: [Pan] filter help
#190578
Author: Mike Dee
Date: Tue, 12 Sep 2006 01:41
31 lines
2367 bytes
On Mon, 11 Sep 2006 16:19:55 +0000, Blinky the Shark wrote:

> Peter J Ross wrote:
>> On 10 Sep 2006 19:26:52 GMT, Blinky the Shark <no.spam@box.invalid>
>> wrote in news.software.readers:
>>
>>> Mike Dee wrote:
>>>>         ~Subject: \b\[?pan\]?\b
>>>
>>> Does the question mark mean "next character not case sensitive"?
>>
>> No. Regexes in pan aren't case-sensitive. The ? means 0 or 1
>> occurences of the previous character. So the regex matches "pan",
>> "Pan" and "PAN"; and "[pan]", "[Pan]" and "[PAN]"; but not "[[pan]]"
>> etc.
> 
> I shoulda known that.  Duh.  :)

No worries, I still couldn't get it right even with my post "correction" :-(

It would've been better (and worked effectively) if I had entered:

             ~Subject: \[?\bpan\b\]?

Now *that* would've worked correctly. However the \[? is probably
superfluous here too. A simple \bpan\b would likely be just as efficient.

Pays to test _before one posts, or drinks_ :-)

-- 
dee
Re: [Pan] filter help
#190579
Author: Tech Zero
Date: Tue, 12 Sep 2006 02:22
33 lines
2190 bytes
This can get as complicated as you like...
I know from the Xnews "world of things" I can use:

  [^news\.software\.readers$]
  Score:: -1000
    Subject: FAQ|Gravity|\btin|Xananews|XPN
    ~Subject: \bx.?(new|face|pat)|filter|new(bie|src)|regex|scor

But I don't know if pan can use the pipe.
Perhaps this is safer...

  [^news\.software\.readers$]
  Score:: -1000
    Subject: FAQ
    Subject: Gravity
    Subject: \btin
    Subject: Xananews
    Subject: XPN
    ~Subject: \bx.?new
    ~Subject: \bx.?face
    ~Subject: \bx.?pat
    ~Subject: filter
    ~Subject: newbie
    ~Subject: newsrc
    ~Subject: regex
    ~Subject: scor

-- 
 __ __| |            __ __|           |    __  /
    |     \    -_)      |   -_)   _|    \     /    -_)   _| _ \
   _|  _| _| \___|     _| \___| \__| _| _| ____| \___| _| \___/

* Xnews Resources: http://xnews.dragonfur.ca *
Re: [Pan] filter help
#190582
Author: Mike Dee
Date: Tue, 12 Sep 2006 09:55
20 lines
2142 bytes
Tech Zero <uselesspam@dragonfur.ca> wrote in
news:Xns983BCF330CC0AlphaTwo@news.dragonfur.ca: 

>   [^news\.software\.readers$]
>   Score:: -1000
>     Subject: FAQ|Gravity|\btin|Xananews|XPN
>     ~Subject: \bx.?(new|face|pat)|filter|new(bie|src)|regex|scor
> 
> But I don't know if pan can use the pipe.
> Perhaps this is safer... 

Yup, Pan can use the pipe, the *only* syntax difference is it uses
SLRN's [*] and not Xnews's [.] 

The only deficiencies in Pan's scoring are not all headers are
supported for scoring (for example scoring Newsgroups and Path are
not supported in the stable version) :-( 

-- 
dee
Re: [Pan] filter help
#190634
Author: Sam Lowry
Date: Thu, 14 Sep 2006 10:52
13 lines
1991 bytes
On Sun, 10 Sep 2006 23:19:12 +1000, Mike Dee wrote:

> If I were to be inclined to limit the posts in NSR to certain clients I
> would probably change the above score to something like this, for example:
> 
> [^news\.software\.readers$]
>      Score:  =-9999
>         ~Subject: \[?pan\]?$|slrn|xnews

OK I have done this, thanks.

-SL
Re: [Pan] filter help
#190661
Author: Mike Dee
Date: Fri, 15 Sep 2006 03:46
34 lines
2359 bytes
Sam Lowry <No.Spam@Thank.You> wrote in
news:pan.2006.09.14.10.52.03.166221@Thank.You: 

> On Sun, 10 Sep 2006 23:19:12 +1000, Mike Dee wrote:
> 
>> If I were to be inclined to limit the posts in NSR to certain
>> clients... : 
>> 
>> [^news\.software\.readers$]
>>      Score:  =-9999
>>         ~Subject: \[?pan\]?$|slrn|xnews
> 
> OK I have done this, thanks.

Good, I hope you will now update this to a more streamlined, less bug 
prone and at least, this time correct:

 [^news\.software\.readers$]
      Score:  =-9999
         ~Subject: \bpan\b|slrn|xnews

But, as NSR gets a larger proportion of Xnews related posts, you may 
not be that interested in seeing all of them. you could remove the 
"|xnews" part of the above script and that would fix it (for good). Or 
you could refine the above slightly to restrict posts you see involving 
Xnews, down to the criteria that Xnews and Pan have in common, i.e. 
PCRE scoring. Here you could have as a small refinement:

 [^news\.software\.readers$]
      Score:  =-9999
         ~Subject: \bpan\b|slrn|xnews.*(filte|\bkill|pcre|scor)

-- 
dee
Re: [Pan] filter help
#190695
Author: Peter J Ross
Date: Sat, 16 Sep 2006 12:33
27 lines
1865 bytes
On Fri, 15 Sep 2006 03:46:42 +0000 (UTC), Mike Dee
<emteedee@invalid.invalid> wrote in news.software.readers:

>  [^news\.software\.readers$]
>       Score:  =-9999
>          ~Subject: \bpan\b|slrn|xnews.*(filte|\bkill|pcre|scor)

But this kills subjects like "filters in xnews". Instead,

	\bpan\b|slrn|((xnews)?.*(filte|\bkill|pcre|scor)(?(1).*|\1))

should match both "xnews filters" and "filters in xnews", as long as
pcre-style back references and conditional subpatterns are
implemented. (If not, just add another, reversed subpattern.)

You might also want to match

	|reg(ular\s)?ex|


PJR :-)
-- 
  _  _(o)_(o)_  _     | The fool hath said in his heart, "There is no Cabal."
._\`:_ F S M _:' \_,  | FSM: <http://www.venganza.org/>
    / (`---'\ `-.     | AUK: <http://www.netcabal.com/auk/>
 ,-`  _)    (_,   F_P | PJR: <http://insurgent.org/~pjr/>
Re: [Pan] filter help
#190711
Author: Tech Zero
Date: Sun, 17 Sep 2006 03:08
27 lines
2343 bytes
Reality folded in on itself, and somewhere the following words from
"Peter J Ross" appeared in history:

> But this kills subjects like "filters in xnews". Instead,
>
>      \bpan\b|slrn|((xnews)?.*(filte|\bkill|pcre|scor)(?(1).*|\1))
>
> should match both "xnews filters" and "filters in xnews", as long as
> pcre-style back references and conditional subpatterns are
> implemented. (If not, just add another, reversed subpattern.)


Or don't bother with the "Xnews specific" and filted based on subject
content which might be similar or the same as your client...

   [^news\.software\.readers$]
     Score:  =-9999
     ~Subject: \bpan\b|slrn|filter|pcre|regex|scor

Which reminds me, I should update my NSR filters.

-- 
 __ __| |            __ __|           |    __  /
    |     \    -_)      |   -_)   _|    \     /    -_)   _| _ \
   _|  _| _| \___|     _| \___| \__| _| _| ____| \___| _| \___/

* Xnews Resources: http://xnews.dragonfur.ca *
Re: [Pan] filter help
#190717
Author: Peter J Ross
Date: Sun, 17 Sep 2006 03:23
38 lines
2454 bytes
On Sat, 16 Sep 2006 21:08:18 -0600, Tech Zero
<uselesspam@dragonfur.ca> wrote in news.software.readers:

> Reality folded in on itself, and somewhere the following words from
> "Peter J Ross" appeared in history:
>
>> But this kills subjects like "filters in xnews". Instead,
>>
>>      \bpan\b|slrn|((xnews)?.*(filte|\bkill|pcre|scor)(?(1).*|\1))
>>
>> should match both "xnews filters" and "filters in xnews", as long as
>> pcre-style back references and conditional subpatterns are
>> implemented. (If not, just add another, reversed subpattern.)
>
>
> Or don't bother with the "Xnews specific" and filted based on subject
> content which might be similar or the same as your client...
>
>    [^news\.software\.readers$]
>      Score:  =-9999
>      ~Subject: \bpan\b|slrn|filter|pcre|regex|scor

Yeah, but where's the fun in that? You're obviously not the kind of
person who prints "man 3 pcrepattern" in order to read it in bed as an
alternative to detective stories and pr0n books. Faugh!

> Which reminds me, I should update my NSR filters.

Why, has AC or J**f_R**f morphed again?


PJR :-)
-- 
  _  _(o)_(o)_  _     | The fool hath said in his heart, "There is no Cabal."
._\`:_ F S M _:' \_,  | FSM: <http://www.venganza.org/>
    / (`---'\ `-.     | AUK: <http://www.netcabal.com/auk/>
 ,-`  _)    (_,   F_P | PJR: <http://insurgent.org/~pjr/>
Re: [Pan] filter help
#190719
Author: Mike Dee
Date: Sun, 17 Sep 2006 04:46
46 lines
3073 bytes
Peter J Ross <pjr@kookbusters.org> wrote in
news:slrnegnrpr.4jb.pjr@nntp.alcatroll.com: 

>>       ~Subject: \bpan\b|slrn|xnews.*(filte|\bkill|pcre|scor)
> 
> But this kills subjects like "filters in xnews". Instead,
> 
>    \bpan\b|slrn|((xnews)?.*(filte|\bkill|pcre|scor)(?(1).*|\1))
> 
> should match both "xnews filters" and "filters in xnews", as long
> as pcre-style back references and conditional subpatterns are
> implemented. (If not, just add another, reversed subpattern.)

I could not get this to work, as is. If I change to a lookahead
assertion of: 

(?>(xnews).*(filte|\bkill|pcre|scor)(?(1).*|\1))

Then it begins to work looking ahead only, but I can't seem to get
the look behind assertions working in this no matter how I try to
juggle it... It would be good if you could revise your post a
little here. My understanding of reversed subpatterns is not too
hot. :)

My following clumsy addition works both ways (no false positives):

~Subject: \bpan\b|slrn|xnews.*(filte|\bkill|pcre|scor)|(filte|\bkill|pcre|scor).*xnews

It doesn't look so attractive though :-(

> You might also want to match
> 
>	|reg(ular\s)?ex|

Changing to an OR condition improves the look and helped pad out
adding extra expressions such as your suggested regex: 

  [^news\.software\.readers$]
       Score::  =-9999
         ~Subject: \bpan\b|slrn
         ~Subject: xnews.*(filte|\bkill|pcre|reg(ular|)\s?ex|scor)
         ~Subject: (filte|\bkill|pcre|reg(ular|)\s?ex|scor).*xnews


-- 
dee
Re: [Pan] filter help
#190720
Author: Mike Dee
Date: Sun, 17 Sep 2006 05:27
24 lines
2539 bytes
Peter J Ross <pjr@kookbusters.org> wrote in
news:slrnegpfu9.70u.pjr@nntp.alcatroll.com: 

> On Sat, 16 Sep 2006 21:08:18 -0600, Tech Zero wrote:
> 
>> Or don't bother with the "Xnews specific" and filted based on
>> subject content which might be similar or the same as your
>> client... 
>>
>>    [^news\.software\.readers$]
>>      Score:  =-9999
>>      ~Subject: \bpan\b|slrn|filter|pcre|regex|scor
> 
> Yeah, but where's the fun in that? You're obviously not the kind
> of person who prints "man 3 pcrepattern" in order to read it in
> bed as an alternative to detective stories and pr0n books. Faugh!

I can see TZ's very good point in keeping to the K.I.S.S. method. But 
it would trigger false positives, in that it falls down if someone 
writes about scoring in any news client other than pan|slrn|xnews - not 
all news clients use PCRE for filtering/scoring.

-- 
dee
Re: [Pan] filter help
#190862
Author: Tech Zero
Date: Wed, 20 Sep 2006 17:23
17 lines
1958 bytes
Reality folded in on itself, and somewhere the following words from
"Peter J Ross" appeared in history:

>> Which reminds me, I should update my NSR filters.
>
> Why, has AC or J**f_R**f morphed again?


Not that I've noticed... };8)
(an I don't fither THOSE in Xnews)

-- 
 __ __| |            __ __|           |    __  /
    |     \    -_)      |   -_)   _|    \     /    -_)   _| _ \
   _|  _| _| \___|     _| \___| \__| _| _| ____| \___| _| \___/

* Xnews Resources: http://xnews.dragonfur.ca *
Re: [Pan] filter help
#190865
Author: Tech Zero
Date: Wed, 20 Sep 2006 17:29
27 lines
2380 bytes
Reality folded in on itself, and somewhere the following words from
"Mike Dee" appeared in history:

> I can see TZ's very good point in keeping to the K.I.S.S. method.

Thanks...

> But it would trigger false positives, in that it falls down if
> someone writes about scoring in any news client other than
> pan|slrn|xnews - not all news clients use PCRE for
> filtering/scoring.

Yes, but that's why I use "a line above" that entry...

   [^news\.software\.readers$]
   Score:: -1000
     Subject: FAQ|Gravity|Xananews
     ~Subject: \bx.?(new|face|pat)|filter|new(bie|src)|pcre|regex|scor

It still keeps it simple, and alows for some lee-way.

-- 
 __ __| |            __ __|           |    __  /
    |     \    -_)      |   -_)   _|    \     /    -_)   _| _ \
   _|  _| _| \___|     _| \___| \__| _| _| ____| \___| _| \___/

* Xnews Resources: http://xnews.dragonfur.ca *
Re: [Pan] filter help
#190886
Author: Peter J Ross
Date: Thu, 21 Sep 2006 12:41
45 lines
2405 bytes
On Sun, 17 Sep 2006 04:46:30 +0000 (UTC), Mike Dee
<emteedee@invalid.invalid> wrote in news.software.readers:

> Peter J Ross <pjr@kookbusters.org> wrote in
> news:slrnegnrpr.4jb.pjr@nntp.alcatroll.com: 
>
>>>       ~Subject: \bpan\b|slrn|xnews.*(filte|\bkill|pcre|scor)
>> 
>> But this kills subjects like "filters in xnews". Instead,
>> 
>>    \bpan\b|slrn|((xnews)?.*(filte|\bkill|pcre|scor)(?(1).*|\1))
>> 
>> should match both "xnews filters" and "filters in xnews", as long
>> as pcre-style back references and conditional subpatterns are
>> implemented. (If not, just add another, reversed subpattern.)
>
> I could not get this to work, as is.

That's because it's broken. (:blush emoticon:)

Try this instead:

    \bpan\b|slrn|(xnews)?.*(filte|\bkill|pcre|scor).*(?(1).*|\1)

In general form,

    (foo)?.*bar.*(?(1).*|\1)

should match both "foo[...]bar" and "bar[...]foo".

Of course,

    foo.*bar|bar.*foo

has the same effect in any regex implementation that supports the OR
operator, but has no Geek Cred at all.


PJR :-)
-- 
  _  _(o)_(o)_  _     | The fool hath said in his heart, "There is no Cabal."
._\`:_ F S M _:' \_,  | FSM: <http://www.venganza.org/>
    / (`---'\ `-.     | AUK: <http://www.netcabal.com/auk/>
 ,-`  _)    (_,   F_P | PJR: <http://insurgent.org/~pjr/>
Re: [Pan] filter help
#190909
Author: Mike Dee
Date: Fri, 22 Sep 2006 07:31
16 lines
2129 bytes
Peter J Ross <pjr@kookbusters.org> wrote in 
news:slrneh523g.4bq.pjr@nntp.alcatroll.com:

> Try this instead:
> 
>     \bpan\b|slrn|(xnews)?.*(filte|\bkill|pcre|scor).*(?(1).*|\1)

Nope, no go. As is, it works in forward motion OK, the look behind 
assertion is still broken :-(

That is:
"xnews is great at filtering out nuisances" works
"filtering out nuisances with xnews, cool!" fails.

-- 
dee
Re: [Pan] filter help
#190923
Author: Peter J Ross
Date: Sat, 23 Sep 2006 14:55
37 lines
2349 bytes
On Fri, 22 Sep 2006 07:31:54 +0000 (UTC), Mike Dee
<emteedee@invalid.invalid> wrote in news.software.readers:

> Peter J Ross <pjr@kookbusters.org> wrote in 
> news:slrneh523g.4bq.pjr@nntp.alcatroll.com:
>
>> Try this instead:
>> 
>>     \bpan\b|slrn|(xnews)?.*(filte|\bkill|pcre|scor).*(?(1).*|\1)
>
> Nope, no go. As is, it works in forward motion OK, the look behind 
> assertion is still broken :-(
>
> That is:
> "xnews is great at filtering out nuisances" works
> "filtering out nuisances with xnews, cool!" fails.

<gnashes teeth, tears hair>

My test expression produced a false positive that I misread as a true
positive.

It seems that there's nothing better than the /foo.*bar|bar.*foo/
syntax. However, the following might also work and save keystrokes:

    \bpan\b|slrn|(xnews).*(filte|\bkill|pcre|scor)|(?2).*(?1)

See "Subpatterns as subroutines" in man pcrepattern.


PJR :-)
-- 
  _  _(o)_(o)_  _     | The fool hath said in his heart, "There is no Cabal."
._\`:_ F S M _:' \_,  | FSM: <http://www.venganza.org/>
    / (`---'\ `-.     | AUK: <http://www.netcabal.com/auk/>
 ,-`  _)    (_,   F_P | PJR: <http://insurgent.org/~pjr/>
Re: [Pan] filter help
#190939
Author: Mike Dee
Date: Mon, 25 Sep 2006 12:10
40 lines
2877 bytes
On Sat, 23 Sep 2006 15:55:19 +0100, Peter J Ross wrote:

>>>     \bpan\b|slrn|(xnews)?.*(filte|\bkill|pcre|scor).*(?(1).*|\1)
>>
[...]
>> "xnews is great at filtering out nuisances" works
>> "filtering out nuisances with xnews, cool!" fails.
> 
> <gnashes teeth, tears hair>
> 
> My test expression produced a false positive that I misread as a true
> positive.
> 
> It seems that there's nothing better than the /foo.*bar|bar.*foo/
> syntax.

You're darn toot'n! At least, myself, slrn, xnews and pan understand
this method without loss of braincells, hair, or gnashing of teeth.

> However, the following might also work and save keystrokes:
> 
>     \bpan\b|slrn|(xnews).*(filte|\bkill|pcre|scor)|(?2).*(?1)

No no no, go back. The previous example was working in one direction.
This one fails in both (in Xnews).

That is, Xnews's built-in pcre checker tells me so - fails on
unknown character after the "?" - doesn't elaborate on which "?"...
Actual error msg: "Perlre: unrecognized character after (?"
 
> See "Subpatterns as subroutines" in man pcrepattern.

Hmmm... I have tried to understand more complex
methods of getting a seemingly simple task done but I'm coming to the
conclusion '/foo.*bar|bar.*foo/' wins because of it's ease of use to
implement and it's straight forward readability, especially in small or
short scripts.

-- 
dee
Re: [Pan] filter help
#190986
Author: Peter J Ross
Date: Tue, 26 Sep 2006 12:34
82 lines
3672 bytes
On Mon, 25 Sep 2006 22:10:37 +1000, Mike Dee <mikedee@invalid.invalid>
wrote in news.software.readers:

> On Sat, 23 Sep 2006 15:55:19 +0100, Peter J Ross wrote:
>
>>>>     \bpan\b|slrn|(xnews)?.*(filte|\bkill|pcre|scor).*(?(1).*|\1)
>>>
> [...]
>>> "xnews is great at filtering out nuisances" works
>>> "filtering out nuisances with xnews, cool!" fails.
>> 
>> <gnashes teeth, tears hair>
>> 
>> My test expression produced a false positive that I misread as a true
>> positive.
>> 
>> It seems that there's nothing better than the /foo.*bar|bar.*foo/
>> syntax.
>
> You're darn toot'n! At least, myself, slrn, xnews and pan understand
> this method without loss of braincells, hair, or gnashing of teeth.

Slrn doesn't understand "|" (or \b, AFAIK).

http://www.s-lang.org/doc/html/slang-20.html

>> However, the following might also work and save keystrokes:
>> 
>>     \bpan\b|slrn|(xnews).*(filte|\bkill|pcre|scor)|(?2).*(?1)
>
> No no no, go back. The previous example was working in one direction.
> This one fails in both (in Xnews).
>
> That is, Xnews's built-in pcre checker tells me so - fails on
> unknown character after the "?" - doesn't elaborate on which "?"...
> Actual error msg: "Perlre: unrecognized character after (?"

This may be a problem with XNews's pcre implementation, since it works
in tin, and pcretest has no complaints:

#v+

pjr@etch:~$ pcretest
PCRE version 6.4 05-Sep-2005

re> /\bpan\b|slrn|(xnews).*(filte|\bkill|pcre|scor)|(?2).*(?1)/
data> xnews filters
 0: xnews filte
 1: xnews
 2: filte
data> filters xnews
 0: filters xnews
 1: <unset>
 2: <unset>
data> pan
 0: pan
data> slrn
 0: slrn
data> filter
 No match
data>

#v-

>> See "Subpatterns as subroutines" in man pcrepattern.
>
> Hmmm... I have tried to understand more complex
> methods of getting a seemingly simple task done but I'm coming to the
> conclusion '/foo.*bar|bar.*foo/' wins because of it's ease of use to
> implement and it's straight forward readability, especially in small or
> short scripts.

It's a matter of personal taste - unless only one method works.


PJR :-)
-- 
  _  _(o)_(o)_  _     | The fool hath said in his heart, "There is no Cabal."
._\`:_ F S M _:' \_,  | FSM: <http://www.venganza.org/>
    / (`---'\ `-.     | AUK: <http://www.netcabal.com/auk/>
 ,-`  _)    (_,   F_P | PJR: <http://insurgent.org/~pjr/>
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