Article View: news.software.readers
Article #263967Re: Any extant syntax to concisely describe pattern-matching for articles?
From: Eli the Bearded
Date: Mon, 06 Apr 2020 00:35
Date: Mon, 06 Apr 2020 00:35
66 lines
3717 bytes
3717 bytes
In news.software.readers, J.B. Nicholson <jbn@forestfield.org> wrote:
> I need a way to concisely describe criteria to match a set of articles
> in a newsreader. The criteria is given by the user ad-hoc at runtime
> and would handle statements like:
>
> * Subject header contains the substring "foo".
> * Posted date is after 2010-10-05.
> * Posted date is before 2015-05-11.
> * From header contains the substring "bar".
Are those supposed only be independing actions, or are you envisioning
a statement system that includes ORs or ANDs?
trn (and earlier rn) killfiles can apply regexps to arbitrary headers,
and have a optimize mode for just "overview" file headers, which load
faster than ordinary headers.
A quote from the manpage:
/pattern/modifiers:command{:command}
Apply the commands listed to articles matching the search
command (possibly with h, a, b, r, or K modifiers). The
default action, if no command is specified, is to select the
article's item in the selector (e.g. the entire thread ("++")
in the thread selector). See the section on Regular
Expressions and the description of pattern searching in the
Article Selection section.
One example: to scan all the unread articles looking for
"topic" anywhere in the article and then select its group and
save the articles to the files topic.1, topic.2, etc. use
"/topic/a:++:s topic.%#".
Modifiers include (header ones must be last):
Hheadername for overview file headers
hheadername for any header
a for anywhere in headers or body
b for article body searches with signature detection
B for article body searches including signatures
Commands include
j junk (mark read, with xref following)
x mark read, no xref usage
+ select article
++ select entire thread
s dest save to dest
| prog pipe to program
It doesn't have any facility for parsing date headers and operating on them,
but your < > operators could probably be used.
> If you know of such a thing, would you please point me in the
> direction of the relevant published standard, documentation, or specs
> for this syntax or functionality? I'd like to learn more about that
> and avoid reinventing this wheel.
http://www.faqs.org/faqs/killfile-faq/
The FAQ is easier to understand than the manpage. Looking at examples of
mail filtering languages might be useful, too.
Elijah
------
procmail is very complicated but similarly powerful
Technical Details
Message-ID:
<eli$2004052016@qaz.wtf>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<slrnr8j12r.2k8.jbn@forestfield.org>Show Full Headers
Complete Article Headers
Message-ID: <eli$2004052016@qaz.wtf> Subject: Re: Any extant syntax to concisely describe pattern-matching for articles? Date: Mon, 06 Apr 2020 00:35:58 +0000 From: Eli the Bearded <*@eli.users.panix.com> References: <slrnr8j12r.2k8.jbn@forestfield.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix Xfrom: is a real address Encrypted: double rot-13 Newsgroups: news.software.readers X-Trace: reader2.panix.com 1586133358 15501 166.84.1.5 (6 Apr 2020 00:35:58 GMT) X-Us-Congress: Moronic Fucks. User-Agent: Vectrex rn 2.1 (beta) Organization: Some absurd concept X-Complaints-To: abuse@panix.com Nntp-Posting-Host: panix5.panix.com Lines: 66 Nntp-Posting-Date: Mon, 6 Apr 2020 00:35:58 +0000 (UTC) X-Attribution: EtB X-Liz: It's actually happened, the entire Internet is a massive game of Redcode