🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #202385

[slrn] strip_was_regexp (was: Changing the subject header of a thread?)

#202385
From: Peter J Ross
Date: Tue, 24 Jul 2007 20:30
70 lines
3488 bytes
In news.software.readers on Tue, 24 Jul 2007 20:17:09 +0100, Adam Funk
<a24061@ducksburg.com> wrote:

> On 2007-07-13, Peter J Ross wrote:
>
>>>>>   Also a good newsreader (like mine :-)), will automatically strip the
>>>>> "(was: ...)" part when you're responding. I.e. only *one* article will
>>>>> have "(was: ...)", the article in which the Subject: is changed.
>>>>
>>>> Interesting!  (Obviously slrn doesn't do that, or I wouldn't be asking
>>>> the question.)
>>>
>>> Oh yes it does!
>>>
>>> <http://slrn.sourceforge.net/manual/slrn-manual-5.html#strip_was_regexp>
>
> Indeed, and thanks for pointing that out!
>
>
>> Sorry, I should have given an example, since the one in the manual is
>> rather basic:
>>
>> 	strip_was_regexp " ?[([][wW]as:.*[])]$"
>>
>> These regexes differ from the ones used in slrn's scorefile by being
>> case-sensitive (the s-lang default).
>
> The two "[]" in that regexp work really me at first, but I think I've
> figured out that the pattern should be read thus:
>
>  " ?"          optional space
>  "[([]"        either a ( or a [
>  "[wW]as:.*"   obvious meaning
>  "[])]$"       either a ] or a ) then the end of the line
>
> Right?

Yes, right.

> How does that last one work without escaping anything?

Because the "]" immediately follows the "[". The interpreter knows
that "[]" would be nonsense - at least I hope it does, but I'm
generally more familiar with PCRE than with S-Lang regexes.

This should work too:

	[)\]]

If the "]" isn't the first character after the "[", it needs to be
escaped.

I'm hoping that slrn 1.1 will use PCRE, because there's a PCRE module
in S-Lang and nobody prefers S-Lang's native regexes if PCRE is
available.  But I think that fixing the charset problems resulting
from the switch to s-lang 2.X and UTF-8 will be good enough for slrn
1.0. There are no other big problems to delay a 1.0 relasae, are
there?

I know so little about S-Lang that I'm crossposting to CLS-L in case
I'm writing nonsense. In particular, expert scrutiny of

	strip_was_regexp " ?[([][wW]as:.*[])]$"

would be useful to us amateurs.



-- 
PJR :-)
Technical Details
Message-ID: <slrnfacoc2.kgr.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!newscon02.news.prodigy.net!prodigy.net!news.glorb.com!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail
References: <d9lim4-kie.ln1@news.ducksburg.com> <4697cc80$1$79675$dbd41001@news.wanadoo.nl> <gq3lm4-8ja.ln1@news.ducksburg.com> <slrnf9fr8c.ec7.pjr@pjr.gotdns.org> <slrnf9fs71.r4c.pjr@pjr.gotdns.org> <lqvhn4-1u3.ln1@news.ducksburg.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrnfacoc2.kgr.pjr@pjr.gotdns.org>
Subject: [slrn] strip_was_regexp (was: Changing the subject header of a thread?)
Date: Tue, 24 Jul 2007 20:30:59 +0000
From: Peter J Ross <pjr@example.invalid>
References: <d9lim4-kie.ln1@news.ducksburg.com> <4697cc80$1$79675$dbd41001@news.wanadoo.nl> <gq3lm4-8ja.ln1@news.ducksburg.com> <slrnf9fr8c.ec7.pjr@pjr.gotdns.org> <slrnf9fs71.r4c.pjr@pjr.gotdns.org> <lqvhn4-1u3.ln1@news.ducksburg.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!newscon02.news.prodigy.net!prodigy.net!news.glorb.com!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail
Newsgroups: news.software.readers,comp.lang.s-lang
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: 70
NNTP-Posting-Date: 24 Jul 2007 15:30:59 CDT
X-Trace: DXC=SXK6B1kGgAmP15DOXYF6eb]AGWjF5PjPi465Ue@WB_5oVd6eKGneGDc26Z<EbT:a\elV3mi\haFghnKNSiQ2:B?n\1hN>La8K\k