🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #203011

Re: Filtering Google Groups: I give up :-)

#203011
From: Peter J Ross
Date: Fri, 03 Aug 2007 18:59
119 lines
5118 bytes
In news.software.readers on 3 Aug 2007 17:01:09 GMT, Blinky the Shark
<no.spam@box.invalid> wrote:

> I *think* most of the differnce is that some stuff has to be escaped in
> Xnews but not slrn.  I hope someone can add more info here.

Different things have to be escaped, because Xnews uses
Perl-compatible regular expressions and slrn uses S-lang-compatible
regular expressions, but some things have to be escaped in both
newsreaders' scorefiles.

There was some discussion here:
<http://groups.google.co.uk/group/news.software.readers/browse_thread/thread/674242aab04b7979/ed5dea552c5649b0>

The pjr.gotdns.org web page I referred to during the discussion isn't
currently available (because I want more than one page before
announcing my slrn help pages to the world, and because I've been too
lazy to add much), but this is what it said:


S-Lang and PCRE differences
===========================

Introduction
------------

Several newsreaders, such as Pan, Xnews and Tin, use Perl-Compatible
Regular Expressions (PCRE) in their scorefiles. Slrn is unusual in
using S-Lang's simple inbuilt regular expression routines instead. The
following is a guide for intermediate users of PCRE-enabled
newsreaders (not beginners or experts) who wish to convert the regular
expressions in their existing scorefiles for use in Slrn. Please note
that this is currently work in progress.

Case-sensitivity
----------------

In PCRE, case-sensitivity is turned on with (?-i) and turned off with
(?i). In S-Lang the equivalents are \c and \C.

Examples:

   % Pan or Xnews:
   Score: =-9999
   Subject: (?-i)HELP
   Score: =9999
   Subject: (?i)slrn

These rules kill posts whose subject includes "HELP" (but not "help"
or "Help"), and mark other posts whose subjects include "slrn", "SLRN"
or "Slrn" as interesting. The exact equivalent in Slrn is as follows:

   % Slrn:
   Score: =-9999
   Subject: \cHELP
   Score: =9999
   Subject: \Cslrn

### added note: case-sensitivity is OFF by default in slrn scorefiles;
### I don't know what the default is for the PCRE newsreaders.


Word boundaries
---------------

In PCRE, word boundaries are matched with \b. In S-Lang, a distinction
is made between the beginning of a word and its end, \< being used for
the former and \> for the latter.

Examples:

   % Pan or Xnews
   Score: =-9999
   From: \bfred\b

   % Slrn
   Score: =-9999
   From: \<fred\>

Both rules match "fred" but not "alfred" or "frederick".

Parentheses
-----------

In both S-Lang and PCRE, parentheses can be either literal matches for
parenthesis characters or indications that part of a regular
expression is to be treated as a group, depending on whether they're
escaped or not, but the syntax is reversed in the two languages.

   PCRE:   ( and ) group a sub-expression; \( and \) are literal matches.
   S-Lang: \( and \) group a sub-expression; ( and ) are literal matches.

Examples:

   % Pan or Xnews
   Score: =-9999
   From: (kook)\1\1
   Subject: \(off-topic\)

   % Slrn
   Score: =-9999
   From: \(kook\)\1\1
   Subject: (off-topic)

Both examples match messages written by "kookkookkook" whose Subjects
contain the literal string "(off-topic)".

Note that such back references as \1, \2, etc are the only use for
grouping parentheses in S-Lang. Patterns such as (foo)+ have no S-Lang
equivalent. In S-Lang, ?, + and * match only a single preceding
character or character class.



(The above text is GPL'ed, if anybody wants to copy and improve it.)


-- 
PJR :-)
Technical Details
Message-ID: <slrnfb6uo8.ctl.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!nx02.iad01.newshosting.com!newshosting.com!204.153.245.136.MISMATCH!aqua.octanews.net!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail
References: <slrnfb57r2.eff.andrew@ilium.invalid> <slrnfb5a0t.lor.no.spam@thurston.blinkynet.net> <slrnfb5ac8.fni.andrew@ilium.invalid> <slrnfb5gcf.lor.no.spam@thurston.blinkynet.net> <Xns998132E0955FElostthreads@216.196.97.136> <20070803192349@usenet.piggo.com> <Xns99813B70D34F3lostthreads@216.196.97.136> <slrnfb5vml.mdj.andrew@ilium.invalid> <Xns99814080AD7A2lostthreads@216.196.97.136> <slrnfb6nsm.4vm.no.spam@thurston.blinkynet.net>

Show Full Headers
Complete Article Headers
Message-ID: <slrnfb6uo8.ctl.pjr@pjr.gotdns.org>
Subject: Re: Filtering Google Groups: I give up :-)
Date: Fri, 03 Aug 2007 18:59:21 +0000
From: Peter J Ross <pjr@example.invalid>
References: <slrnfb57r2.eff.andrew@ilium.invalid> <slrnfb5a0t.lor.no.spam@thurston.blinkynet.net> <slrnfb5ac8.fni.andrew@ilium.invalid> <slrnfb5gcf.lor.no.spam@thurston.blinkynet.net> <Xns998132E0955FElostthreads@216.196.97.136> <20070803192349@usenet.piggo.com> <Xns99813B70D34F3lostthreads@216.196.97.136> <slrnfb5vml.mdj.andrew@ilium.invalid> <Xns99814080AD7A2lostthreads@216.196.97.136> <slrnfb6nsm.4vm.no.spam@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!nx02.iad01.newshosting.com!newshosting.com!204.153.245.136.MISMATCH!aqua.octanews.net!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail
Newsgroups: news.software.readers
Organization: none
Reply-To: pjr.spam@gmail.com
User-Agent: slrn/0.9.8.1pl2.1 (Linux)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 119
NNTP-Posting-Date: 03 Aug 2007 13:59:21 CDT
X-Trace: DXC=aJim8@:jSAA;
 lJ0R72AR0L]AGWjF5PjPI465Ue@WB_5O6]_\NQZi26J26Z<EbT:a\E2XQX54M@PfBkDhH;
 9a4AYGPGoeJnFOP=C