Article View: news.software.readers
Article #151684Re: [slrn/S-Lang] RegEx for duplicate signature delimiters
From: DC
Date: Mon, 12 Jul 2004 20:43
Date: Mon, 12 Jul 2004 20:43
81 lines
3713 bytes
3713 bytes
Lars Stokholm wrote: > 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) > 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. I've been using this in .slrnrc: % Define regular expression used to detect signatures % Thanks to ras2 (nsr) strip_sig_regexp "^-- ?$" "^- -- ?$" "^--- ?$" Works for me. > 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. > 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. See above. > 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. Okay. > 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. :) I don't do s-lang, so I can't be of very much help. FWIW, I scanned it and notice what I *think* is an effort to strip out empty lines. Blinky shared this with me, a while back, which solves this nicely for my porpoises. };O) In .gvim.rc: " delete quote indicators on empty lines " from w.citoan in n.s.r: au BufRead ~/.followup :% s/^>[ >]*$// 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) -- DC Linux RU #1000111011000111001 Free your mind, and your OS will follow...
Technical Details
Message-ID:
<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.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-lei1.dfn.de!news1.uni-leipzig.de!fu-berlin.de!uni-berlin.de!not-for-mailReferences:
<slrn.cf3cr3.70@stokholm.dyndns.dk> <slrncf5nhe.b8a.dcmoose@moosemeat.ca.INVALID> <slrn.cf5pmt.68@stokholm.dyndns.dk>Show Full Headers
Complete Article Headers
Message-ID: <slrncf5tvc.b8a.dcmoose@moosemeat.ca.INVALID>
Subject: Re: [slrn/S-Lang] RegEx for duplicate signature delimiters
Date: Mon, 12 Jul 2004 20:43:24 +0000
From: DC <dcmoose@myrealbox.com>
References: <slrn.cf3cr3.70@stokholm.dyndns.dk> <slrncf5nhe.b8a.dcmoose@moosemeat.ca.INVALID> <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.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-lei1.dfn.de!news1.uni-leipzig.de!fu-berlin.de!uni-berlin.de!not-for-mail
Newsgroups: news.software.readers
Organization: http://dcicons.fateback.com
Lines: 81
X-Trace: news.uni-berlin.de H3xNhHbPUdZ6j7QFjKhf3A0+PnfJQ+sPMQEd1kHYL9FOexFfvX
X-Operating-System: Mandrake Linux 10.0 (Kernel 2.6.3-7mdk)
X-Face: 6k$Xf_V^i#2X;
X~[=Ra6mGRtOw!^s%HmaNj1y5a>YCL"vEl.Jjbkww,E~kI&f[*w{j:$V6a2:LKbWg@+qt)3x"fqU\H_Fy5tk8h[Iq/XW~okpDvCa\E~!fb]{H4j@CxE<vL?4q9cxiK5;
ZdpI@,Bk)(\e67mAw; L}WCZ/NYSX|R6Jj{omL6KT/$
User-Agent: slrn/0.9.8.0 (Linux)