Compound expressions?

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

Compound expressions?

Postby macraig » Mon Jul 16, 2001 9:37 pm

Is it possible to construct compound expressions for the new regexp subject and file filters? In particular, is it possible to construct an expression that would look for multiple words in the subject, IN ANY ORDER?

In other words, for example:

(mother)&(daughter)&(sex)

I gather that ORing is possible using "|", but are there other supported conjunctions (AND, NAND, NOT, NOR, XOR, etc.)?

Mark Craig
User avatar
macraig
Active Participant
Active Participant
 
Posts: 72
Joined: Sat Jun 23, 2001 12:02 am
Location: California

Registered Newsbin User since: 08/22/02

RE: Compound expressions?

Postby dexter » Tue Jul 17, 2001 11:30 am

I don't know of a single line RegEx to find multiple sets of strings in any order. You can accomplish this by entering each string as a separate filter and NewsBin will apply each one in sequence. That is probably the best bet.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9511
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97

RE: Compound expressions?

Postby macraig » Thu Jul 19, 2001 5:58 am

>You can accomplish this by entering each string
>as a separate filter and NewsBin will apply each one
>in sequence.

That won't work for my example or what I had in mind, though maybe I wasn't clear about it. Your solution would reject any subject that has AT LEAST ONE of the listed words, but what I had in mind was only rejecting subjects that had ALL the words BUT in any order.

Hmmm... wait a minute. Does NB "partially evaluate" each list and skip all the remainder when an expression in the list matches? Or... does NB continue to test all remaining expressions in the list, even after a match? Or to put it another way, is it possible to have multiple expressions match on the same subject/filename?

I've been assuming partial evaluation, but your suggested solution hints that maybe I've assumed wrong?

Mark Craig
User avatar
macraig
Active Participant
Active Participant
 
Posts: 72
Joined: Sat Jun 23, 2001 12:02 am
Location: California

Registered Newsbin User since: 08/22/02

RE: Compound expressions?

Postby dexter » Thu Jul 19, 2001 9:36 pm

No, you're right, that wouldn't work. If you wanted order to matter for 3 different elements, you'd have to enter 9 different filters to catch all the combinations.

If anyone else has any ideas, feel free to pipe up.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9511
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 2 guests