Regex to filter all headers except those that contain a word

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

Regex to filter all headers except those that contain a word

Postby RonMarz » Thu May 26, 2005 7:36 pm

How would I write an expression to filter out all headers except those containing the term "public domain?"

I assume this requires some use of both the Accept and Reject filters, but I haven't correctly doped out the syntax.

Thanks.
RonMarz
Active Participant
Active Participant
 
Posts: 54
Joined: Fri May 31, 2002 3:00 pm

Registered Newsbin User since: 04/25/03

Postby Quade » Thu May 26, 2005 9:25 pm

You add an accept filter only.

"public.*domain" is how I'd do it. No quotes.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44972
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Postby RonMarz » Thu May 26, 2005 9:48 pm

And that causes all other headers to be rejected? I'll give it a try. (Boy, did I have the wrong idea.)
RonMarz
Active Participant
Active Participant
 
Posts: 54
Joined: Fri May 31, 2002 3:00 pm

Registered Newsbin User since: 04/25/03

Postby itimpi » Thu May 26, 2005 10:08 pm

In this case I would expect a Reject filter, not an accept filter.
The Newsbin Online documentation
The Usenettools for tutorials, useful information and links
User avatar
itimpi
Elite NewsBin User
Elite NewsBin User
 
Posts: 12607
Joined: Sat Mar 16, 2002 7:11 am
Location: UK

Registered Newsbin User since: 03/28/03

Postby Quade » Thu May 26, 2005 10:34 pm

Think of it this way.

Accept means "Show ONLY matching"

Whereas

Reject means "Reject ANY Matching".

If you ONLY want to see "Public Domain" then only Accept "Public.*Domain". Should only show you matches.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44972
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Postby RonMarz » Thu May 26, 2005 10:53 pm

All clear now. (I thought Accept meant "OVERRIDE Reject with matching.") Thanks.
RonMarz
Active Participant
Active Participant
 
Posts: 54
Joined: Fri May 31, 2002 3:00 pm

Registered Newsbin User since: 04/25/03

Postby bobkoure » Sat Jul 22, 2006 6:32 pm

Just a nit, but wouldn't you actually want "public\s*domain"?
Not that you are going to get a lot of posts with "public blah blah blah domain blah blah" in 'em...
I'm assuming a title with "publicdomain" should be matched (as did you with the .*).
bobkoure
 


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 2 guests