🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #151673

Re: [slrn/S-Lang] RegEx for duplicate signature delimiters

#151673
From: Lars Stokholm
Date: Mon, 12 Jul 2004 19:30
35 lines
2455 bytes
DC wrote:

>> string_match (article, "\n-- \n.*\\(\n-- \n\\)", 1);

[...]

> Not in answer to your question:  just curious about what you are trying
> to accomplish.  Feel free to tell me to mind my own business.  };O)

Not at all. :)

Some AV-software puts a signature in every outgoing post (like
"Outgoing mail is certified Virus Free" and all that other crap).
Usually it uses "---" for a signature delimiter, so slrn will not
recognize it as a signature. I could add it to strip_sig_regexp,
but instead I wrote a macro to "repair" it.

Now, some newsreaders will of course add a signature for the user,
so if this user also uses some crappy AV-software, suddenly I will
have two signature delimiters in an article, like in my example.
slrn is smart enough to guess that only the last "-- " is actually
intended as a signature delimiter, so it will only hide the latter
of the two signatures in the article.

So, finally, my macro has to detect multiple signature delimiters,
and delete every one but the first. So that was what I was going
to use it for. But I came up with something else on the way.

Below is a link to the macro. It does some other things to the
article too. It's not commented, and parts of the code are probably
garbage, but take a peek if you wish (look for 'fix_dup_sig_delim'):

  http://home19.inet.tele.dk/stokholm/usenet/fixarticle.sl

If you see some really stupid code on your way, let me know. :)
Technical Details
Message-ID: <slrn.cf5pmt.68@stokholm.dyndns.dk>
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.sjc.giganews.com!number1.nntp.dca.giganews.com!internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.tele.dk!not-for-mail
References: <slrn.cf3cr3.70@stokholm.dyndns.dk> <slrncf5nhe.b8a.dcmoose@moosemeat.ca.INVALID>

Show Full Headers
Complete Article Headers
Message-ID: <slrn.cf5pmt.68@stokholm.dyndns.dk>
Subject: Re: [slrn/S-Lang] RegEx for duplicate signature delimiters
Date: Mon, 12 Jul 2004 21:30:37 +0200
From: Lars Stokholm <stokholm@despammed.com>
References: <slrn.cf3cr3.70@stokholm.dyndns.dk> <slrncf5nhe.b8a.dcmoose@moosemeat.ca.INVALID>
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.sjc.giganews.com!number1.nntp.dca.giganews.com!internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.tele.dk!not-for-mail
Newsgroups: news.software.readers
User-Agent: slrn/0.9.8.0 (Win32)
Lines: 35
Organization: TDC Totalloesninger
NNTP-Posting-Host: 62.243.16.82
X-Trace: 1089660640 dtext01.news.tele.dk 184 62.243.16.82:47587
X-Complaints-To: abuse@post.tele.dk