🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
3 messages
3 total messages Started by J.B. Nicholson Sun, 05 Apr 2020 07:10
Any extant syntax to concisely describe pattern-matching for articles?
#263961
Author: J.B. Nicholson
Date: Sun, 05 Apr 2020 07:10
29 lines
1926 bytes
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".

Ideally this would be a textual syntax, something typed into a
freeform text entry space (like a command or a GUI text input
area). I'm hoping that someone has considered this and come up with
something that is easy to use, understandable, and functional enough
that one would want to use it. I imagine something like:

subject/foo
date>2010-10-05
date<2015-05-11
from/bar

Does any newsreader offer any syntax to let a user identify or select
a set of articles which match the given criteria?

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.

Thanks.
Re: Any extant syntax to concisely describe pattern-matching for articles?
#263967
Author: Eli the Bearded
Date: Mon, 06 Apr 2020 00:35
66 lines
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
Re: Any extant syntax to concisely describe pattern-matching for articles?
#263966
Author: J.B. Nicholson
Date: Mon, 06 Apr 2020 04:27
24 lines
1854 bytes
Eli the Bearded <*@eli.users.panix.com> wrote:
> Are those supposed only be independing actions, or are you envisioning
> a statement system that includes ORs or ANDs?

That's a good question. I suppose that it would depend on how easy it
would be for users to use the ORs and ANDs. It's hard to say for sure
until I write something and try using it for a while.

> 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.
> [...]
> 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

Thanks a lot for this valuable information, I appreciate the
references and opinions. I'll take a look at all of the items you've
listed.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads