🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
7 messages
7 total messages Started by VanguardLH Tue, 20 Jan 2009 22:34
40tude Dialog: How to AND several regex together?
#229228
Author: VanguardLH
Date: Tue, 20 Jan 2009 22:34
35 lines
3099 bytes
I don't know if this is possible in 40tude Dialog.  While a filter rule
can be defined to check on any header using regex, sometimes I need to
check on a combination of headers.  For example, I may want to check the
message-ID along with the From headers because a troll or imposter is
always going through the same domain shown in the message-ID (but I
don't want to tag everyone using that NSP) and goes by the same name
(but is impostering someone else).  I'd like something similar to:

!ignore, markread Header {^Message-ID:.*<.*@domain>} AND {^From:.*name}

(The above doesn't work.)

The domain would be whatever the imposter is using (which could be more
than one so I'd have to use "(domain1|domain2|...)" and the From has the
name they are impostering.  Alternatively, if the imposter is using lots
of freebie NSPs, but since the original user is always using the same
NSP, I could trigger on From being the name and the Message-ID not being
the real user's domain, like:

!ignore,markread Header ~{^Message-ID:.*<.*@domain>} AND {^From:.*name}

I'm just showing example above since they aren't legal syntax in Dialog.
I'd like to figure out how to AND together multiple regular expressions
to get the effect of a Boolean expression, like:

ignoreimposter if (goodFromName AND wrongMsgIDdomain)

or

ignoreimposter if (goodFromName AND NOT(correctMsgIDdomain))

So far, my filters only have one regex to test against one header.  I'm
wondering if it is possible to define a filter that tests on more than
one header.  My experience has been that the imposter uses a different
NSP than the user they are impostering.
Re: 40tude Dialog: How to AND several regex together?
#229229
Author: Bernd Rose
Date: Tue, 20 Jan 2009 22:57
16 lines
1860 bytes
On Tue, 20 Jan 2009 16:34:39 -0600 wrote VanguardLH:

> !ignore, markread Header {^Message-ID:.*<.*@domain>} AND {^From:.*name}

!ignore, markread Message-ID "@domain" +@From "name"

Don't use RegEx, if you don't need to and don't use "Header" references,
when scoring recognizes a header specifically, like Message-ID. The syntax
+@ ... "AND"
-@ ... "AND NOT"
is derived from Hamster. Actually, for general scoring reference and 
for complex examples you can always have a look at the Hamster help files
or at websites dedicated to Hamster. Few scoring constructs of Hamster are
not supported by 40tude Dialog.

Bernd
Re: 40tude Dialog: How to AND several regex together?
#229230
Author: Oliver Cromm
Date: Tue, 20 Jan 2009 23:22
32 lines
2642 bytes
* VanguardLH <V@nguard.LH> wrote:

> I'd like something similar to:
> 
> !ignore, markread Header {^Message-ID:.*<.*@domain>} AND {^From:.*name}
> 
> (The above doesn't work.)

Is this not in the Help file? It seems not. Bad!

It should work like this:

!ignore, markread Header {^Message-ID:.*<.*@domain>} +@Header:{^From:.*name}

There may be restrictions about using colon and spaces within the +@
part, in my scorefile, I always write it like above.

A rule can have multiple +@ parts. You can also write exceptions as -@.

But this makes more sense, when you are only scoring on standard XOVER
headers:

!ignore, markread Message-ID {<.*@domain>} +@From:{name}

There is also a syntax that reads over line breaks, I can give examples
in case you look for exotic Header contents.

-- 
There are two ways of constructing a software design. One way is to make
it so simple that there are obviously no deficiencies. And the other way
is to make it so complicated that there are no obvious deficiencies.
The first method is far more difficult. -- C. A. R. Hoare
Re: 40tude Dialog: How to AND several regex together?
#229231
Author: Larry Gates
Date: Tue, 20 Jan 2009 23:48
39 lines
2257 bytes
On Tue, 20 Jan 2009 18:22:55 -0500, Oliver Cromm wrote:

> * VanguardLH <V@nguard.LH> wrote:
> 
>> I'd like something similar to:
>> 
>> !ignore, markread Header {^Message-ID:.*<.*@domain>} AND {^From:.*name}
>> 
>> (The above doesn't work.)
> 
> Is this not in the Help file? It seems not. Bad!
> 
> It should work like this:
> 
> !ignore, markread Header {^Message-ID:.*<.*@domain>} +@Header:{^From:.*name}
> 
> There may be restrictions about using colon and spaces within the +@
> part, in my scorefile, I always write it like above.
> 
> A rule can have multiple +@ parts. You can also write exceptions as -@.
> 
> But this makes more sense, when you are only scoring on standard XOVER
> headers:
> 
> !ignore, markread Message-ID {<.*@domain>} +@From:{name}
> 
> There is also a syntax that reads over line breaks, I can give examples
> in case you look for exotic Header contents.

I'd be curious to know which other scripts you have running.  My favorite
one that I've got is a getthread facility that runs off a button.

It looks like perl has a && and an and .  Maybe switching to && could do
something.
-- 
larry gates

The autodecrement is not magical.
             -- Larry Wall in the perl man page
Re: 40tude Dialog: How to AND several regex together?
#229232
Author: VanguardLH
Date: Wed, 21 Jan 2009 01:17
8 lines
1865 bytes
Thanks for all the replies.  They were on the mark.  I was able to
define a filter for the "noisy" newsgroup with the impostered name but
that didn't go through the real user's NSP.  Worked like a charm.  

If Dialog follows most of Hamster's syntax for filter rules, I'll go
hunting to find documentation on Hamster.  Hopefully I don't have to
download and install Hamster to get at its documentation.  To bad Dialog
didn't put this info in its own help.
Re: 40tude Dialog: How to AND several regex together?
#229233
Author: Rom
Date: Wed, 21 Jan 2009 01:18
17 lines
1414 bytes
On Tue, 20 Jan 2009 18:22:55 -0500, Oliver Cromm wrote:

> * VanguardLH <V@nguard.LH> wrote:
> 
>> I'd like something similar to:
>> 
>> !ignore, markread Header {^Message-ID:.*<.*@domain>} AND {^From:.*name}
>> 
>> (The above doesn't work.)
> 
> Is this not in the Help file? It seems not. Bad!

It's here:
<http://www.40tude.com/dialog/wiki/index.php/Frequently_Asked_Questions#Q:_How_can_I_combine_two_conditions_in_one_score_rule.3F>

-- 
Rom
Re: 40tude Dialog: How to AND several regex together?
#229234
Author: VanguardLH
Date: Wed, 21 Jan 2009 01:35
19 lines
2084 bytes
Rom wrote:

> On Tue, 20 Jan 2009 18:22:55 -0500, Oliver Cromm wrote:
> 
>> * VanguardLH <V@nguard.LH> wrote:
>> 
>>> I'd like something similar to:
>>> 
>>> !ignore, markread Header {^Message-ID:.*<.*@domain>} AND {^From:.*name}
>>> 
>>> (The above doesn't work.)
>> 
>> Is this not in the Help file? It seems not. Bad!
> 
> It's here:
> <http://www.40tude.com/dialog/wiki/index.php/Frequently_Asked_Questions#Q:_How_can_I_combine_two_conditions_in_one_score_rule.3F>

Looks like time for me to read their wiki to see what else I can pick up
from there.
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