Page 1 of 1
AND filter and OR filter
Posted: Wed Sep 17, 2003 4:33 am
by Spooky
Can someone please tell me how to make an AND filter and an OR filter? I have never been able to really get some of them to work correctly.
A and B and C
and
A or B or C or D
Whenever I use more than one line in a filter it rarely works, so obviously I am using the select all extract or ban incorrectly.
I want to be able to use separate lines because some keywords are whole words and others are boolean.
Thanks.
Posted: Wed Sep 17, 2003 2:59 pm
by bruce73
AND = &
OR = |
A and B and C = A&B&C
A or B or C = A|B|C
Not sure what you want to include, but, AFAIK, you can combine whole keywords with boolean in one string, as long as you select "boolean".
Posted: Fri Sep 19, 2003 6:27 am
by Spooky
bruce73 wrote:AND = &
OR = |
A and B and C = A&B&C
A or B or C = A|B|C
Not sure what you want to include, but, AFAIK, you can combine whole keywords with boolean in one string, as long as you select "boolean".
I would like:
Subject contains A (whole word) all ban
Subject contains B (whole word) all ban
Subject contains C (whole word) all ban
Subject contains D (whole word) all ban
as an AND filter to start with.
I need separate lines because I might need a whole word for one line and boolean for another line. I do not think you can combine the two, or I don't know how.
I have this filter and I substituted EXTRACT to test it and it extracted nothing.
I cannot understand why it did not work.
Thanks.
Posted: Fri Sep 19, 2003 2:17 pm
by bruce73
If I understand you correctly, you want to eliminate all messages that have A, B, C, or D in the subject line. You'd want to use OR (|), like this:
A|B|C|D apply to all ban
Now, if the filter finds any one of these conditions (A, B, C, D) to be true, it will ban that message.
If one of the conditions were not a whole word, but a Boolean -- for instance, bl*k, it would be:
A|B|C|bl*k apply to all ban
Using the AND (&) to link conditions means that every condition has to be true (i.e. present) in order for the filter to work. So:
A&B&C&D apply to all ban
would ban only those messages that contained all four (A, B, C, D) in the subject line.
Posted: Fri Sep 19, 2003 6:36 pm
by Spooky
Okay, this is interesting.
I meant to say OR and not AND.
Using your example, I made a filter like the following:
r&f whole word all extract
and it worked (I will be using ban after I know it works).
Now for the interesting part!
r&f | loveline whole word all extract
DOES NOT WORK!
As soon as the OR (|) is added, it stops working. I can't figure that one out! I'm trying to use this as a premade kill filter for a group.
Could it be that you can't use "whole word" and an OR "|" function in the same line? Although separate lines for whole words didn't work either.
Can someone try to reproduce this and please prove me wrong???
Thanks.
Posted: Fri Sep 19, 2003 10:50 pm
by bruce73
I'm assuming, in your example, that r=word1 and f=word2. Then,
r&f apply to all extract
gives you all posts with subject lines containing both 'r' and 'f', correct?
Using the OR (|), make sure there are no spaces immediately before or after it; try writing it like this:
r&f|loveline
You should get posts with subject lines containing both 'r' and 'f', plus those containing 'loveline'.
If you want to use separate lines for whole words, try this:
Word1 apply to all select;
Word2 apply to unselected extract
This should catch all messages with Word1 and/or Word2 in the subject line.
Posted: Sat Sep 20, 2003 12:10 am
by Spooky
Ok, that worked!
I think my problem is I don't know when to choose all, selected or unselected. That part of the filters is entirely unclear to me!
Can you give me an example like you did before that has 4 or more lines?? That would really help!
Thanks.
Posted: Sat Sep 20, 2003 1:29 am
by bruce73
Basically thinking of the filtering process as whittling away what you don't want by selecting what you do, you start with all posts.
The first line (or condition) is applied to all posts, and selected. The next line is another condition by which you want to select, so it is applied to what hasn't been already selected ("unselected") by choosing "select", and that selection is added to the first. The third condition, likewise, is now applied to what is still not selected, and that selection is added to the first two. This goes on for however many lines you want, I suppose.
The last condition, which selects the final group from the unselected posts, is applied, not by "select" but by "extract." Extract is a combination of select and extract, and the final command of the filter must be extract (or ban, which also implies select, if you're creating a kill filter), since you now want to apply the filter.
An example:
Subject (or author, or whatever) contains A all select;
Subject contains B unsel select;
Subject contains C unsel select;
Subject contains D unsel extract ( or ban, if this is a kill filter).
Does this make sense? You're constantly increasing the amount of selected posts (from the pool of previously unselected posts) with each condition until the last one, where you finalize it by extracting or banning.
Posted: Mon Sep 22, 2003 9:16 am
by Spooky
I was going to say I still could not get the OR to work, but after some fiddling I think I got it to work right.
Many thanks for your help!
The key seemed to be using \ before the & as in r\&f
It seems my filter was picking occurences of r and f in a subject instead of r&f as a whole word.
I hope this is of use to others with my predicament.
In the end, I still do not see the point of the filtering system employed by Newspro. Is there any real need to keep adding bits of information instead of hitting everything at one time? I think I am just too used to Agent. The current filtering scheme in Newspro just does not seem very intuitive to me.
I'm curious if Newspro is styled after a programming language I'm unfamiliar with. Does anyone know what it is written in?
A more detailed help section on the regular expressions would be very useful, or at least a pointer to an existing one would help. Is this Unix based??? (I always hated Unix, what I can remember of it)
Anyway thanks for your diligence!