🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
3 messages
3 total messages Started by Jeremy Mathers Mon, 08 Nov 1993 17:52
TRN: Killfile Question
#6407
Author: Jeremy Mathers
Date: Mon, 08 Nov 1993 17:52
30 lines
1886 bytes
I would like to be able to select articles based on sender.  So have
lines like:

/^From.*Kamsky/h+

in my killfile.  Now, I would like to be able to select on more than one
user in this group.  I could of course, repeat the line above for each
user but that seems messy and inefficient.  What I would like to is:

/^From.*\(User1\|User2\|User3\)/h+

I.e., match From followed by any of the 3 usernames.  But "man trn"
tells me that:

	... matched.   Up  to  10  alternatives  may given in a pattern,
	separated by \|, with the caveat  that  \( ... \| ... \)  is
	illegal.

Now, I ask you, of what value is the \( ... \) construct if not for this?
Seriously, isn't this one of the more common applications of this sort
of reg exp?  And, can this thing be done (in trn 2.2)?

************************************************************************
La plus belle fille du monde ne peut
donner que tout ce qu'elle a.

	- pynq@quads.uchicago.edu, who is still costing the net
	  hundreds, if not thousands, of dollars, every time he posts -
************************************************************************
rwvpf wpnrrj ibf ijrfer
Re: TRN: Killfile Question
#6425
Author: mathew
Date: Tue, 09 Nov 1993 12:16
18 lines
1146 bytes
In article <1993Nov8.175215.6637@midway.uchicago.edu>,
Jeremy Mathers <pynq@midway.uchicago.edu> wrote:
>I would like to be able to select articles based on sender.  So have
>lines like:
>
>/^From.*Kamsky/h+

Using

/Kamsky/f:+

would be neater and faster, because it doesn't have to read the entire
header.


mathew
-- 
/X-Attribution:/h:j -- just say no to SuperCite
Re: TRN: Killfile Question
#6552
Author: Wayne Davison
Date: Wed, 17 Nov 1993 19:39
33 lines
1880 bytes
According to Jeremy Mathers <pynq@midway.uchicago.edu>:
> /^From.*\(User1\|User2\|User3\)/h+
> [...is illegal...]
> Now, I ask you, of what value is the \( ... \) construct if not for this?

The \( ... \) construct can be used for tagging text for reuse, like this
construct that formats the output of the '=' command.  Note the use of %1:

-ESUBJLINE="\
%(%(%f=(\\(..*\\))$?%1 <%t>:%t)               =^\\(...............\\)?%1) \
(%(   %[lines]=\\(...\\)$?%1)) \
%(%[subject]=^\\(....................................................\\)?\
%1:%[subject])"

However, I agree with you that a better regex routine that would handle
\| inside of parens is very desirable.  I know of one fellow who has
plugged in an alternate regex package into trn (trn was modified in
version 3.0 to make this easier) but I've not yet gotten a replacement
that is fully compatible (and freely redisributable is also important).

In the meantime, you could install trn 3.3 and use the construct:

/User1\|User2\|User3/f:+

to select multiple people in the from line.  The generic form is also
available:

/String1\|String2\|String3/Hheader-line:+

which selects the strings on the specified "Header-Line:" in the header.
-- 
Wayne Davison
davison@borland.com
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