Article View: news.software.readers
Article #151686Re: [slrn/S-Lang] RegEx for duplicate signature delimiters
From: Lars Stokholm
Date: Mon, 12 Jul 2004 21:32
Date: Mon, 12 Jul 2004 21:32
83 lines
4030 bytes
4030 bytes
DC skrev:
> strip_sig_regexp "^-- ?$" "^- -- ?$" "^--- ?$"
>
> Works for me.
That was my alternative, yes. It won't do it though; it will only
recognize the latter of these as a signature:
#v+
Hey, how are you?
--
My correct signature
---
Broken AV signature
#v-
That's not enough for me, I want to be able to colour and hide it all.
>> 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.
>
> AVG, anyone? My solution fixes that -- it's why I sought it out, to
> begin with.
My example was from AVG, yes. :) I don't get it if it works for you.
> FWIW, I scanned it and notice what I *think* is an effort to strip out
> empty lines.
It removes multiple empty lines from an article, also multiple empty
*quoted* lines; like this:
>> I said something.
>> \
>> ) It cut's these three down to one.
>> /
>> I said something more.
...but only up to second level of qouting though, since I hide away
higher levels anyway.
> Blinky shared this with me, a while back, which solves this nicely
> for my porpoises. };O)
Thanks, but that's for stripping it out on forwarding, right? What I'm
doing is stripping it from the article, before it is displayed in the
pager (using the 'replace_article' function).
By the way, I thought I saw the word "gvim". ;) I'm still with Metapad,
despite many attempts to learn something else...
> Let us know how you make out with the macro. Once you've documented it,
> I wouldn't mind test driving it for you. I'm always on the lookout for
> new toys. }:O)
I can give you a short description, if you like. First of all, it
works on the article in the pager. And:
- It replaces bad signature delimiters ("--", "---" and "-- \n-- ")
with "-- ".
- It makes sure that an article only has one signature delimter.
- It removes multiple empty lines and ditto quoted lines up to the
second level. That compacts the article a little for some posters.
- It cleans up on English and Danish OE 6.0 attribution lines.
- If the article is modified, a message is given in the status line,
with a short list of the changes.
- It has a function 'switch_art', which you can bind to a key, that
will let you switch between the modified and original article.
That's it for now. I made a helping function 'rep_regex_substr',
that will let me replace a regular expression with a string. That
came up really handy for cleaning out in empty quoted lines:
rep_regex_substr ("\n *> *> *\n *> *> *\n", "\n>>\n")
Please everyone, don't tell me S-Lang had a function for that. :)
Technical Details
Message-ID:
<slrn.cf60r2.1gk@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.sjc.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!news-hub.cableinet.net!blueyonder!news-out.ntli.net!newsrout1.ntli.net!news-in.ntli.net!ntli.net!colt.net!news.tele.dk!not-for-mailReferences:
<slrn.cf3cr3.70@stokholm.dyndns.dk> <slrncf5nhe.b8a.dcmoose@moosemeat.ca.INVALID> <slrn.cf5pmt.68@stokholm.dyndns.dk> <slrncf5tvc.b8a.dcmoose@moosemeat.ca.INVALID>Show Full Headers
Complete Article Headers
Message-ID: <slrn.cf60r2.1gk@stokholm.dyndns.dk> Subject: Re: [slrn/S-Lang] RegEx for duplicate signature delimiters Date: Mon, 12 Jul 2004 23:32:18 +0200 From: Lars Stokholm <stokholm@despammed.com> References: <slrn.cf3cr3.70@stokholm.dyndns.dk> <slrncf5nhe.b8a.dcmoose@moosemeat.ca.INVALID> <slrn.cf5pmt.68@stokholm.dyndns.dk> <slrncf5tvc.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.sjc.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!news-hub.cableinet.net!blueyonder!news-out.ntli.net!newsrout1.ntli.net!news-in.ntli.net!ntli.net!colt.net!news.tele.dk!not-for-mail Newsgroups: news.software.readers User-Agent: slrn/0.9.8.0 (Win32) Lines: 83 Organization: TDC Totalloesninger NNTP-Posting-Host: 62.243.16.82 X-Trace: 1089667942 dtext01.news.tele.dk 178 62.243.16.82:1184 X-Complaints-To: abuse@post.tele.dk