Page 1 of 1

Using RegEx to show only RAR posts

PostPosted: Fri May 18, 2001 3:50 pm
by dexter
Use the "Find In Subject" feature to isolate the .rXX files using Regular Expressions (RegEx). This RegEx will show all the .r?? files: \.r[a0-9][r0-9]. In english, this means look for a "." (the "\" escapes the ".", otherwise it means "match any single character") then match an "r", then match either an "a" or a digit 0 through 9, then match an "r" or a digit 0 through 9. If you are looking for a specific series like "amovie.rXX", use amovie\.r[a0-9][r0-9].

For a more thorough example, see http://www.newsbin.com/howto/rar.htm.

Have fun,

Dexter ;-)

RE: Using RegEx to show only RAR posts

PostPosted: Sat May 26, 2001 3:51 am
by Kobato
You Should include [r-z] because after .r99 come .s00 .t00etc... \.[r-z][a0-9][r0-9]

RE: Using RegEx to show only RAR posts

PostPosted: Sat May 26, 2001 12:34 pm
by dexter
Yes, you're right, that would catch everything. I left that out of the original example to keep it simple and because very few rar posts I've encountered actually go into "s" and beyond.

RE: Using RegEx to show only RAR posts

PostPosted: Tue Jun 05, 2001 12:09 pm
by TimeOut
dexter what level of RE does newsbin support? classic? egrep? gnu? thanks.

RE: Using RegEx to show only RAR posts

PostPosted: Tue Jun 05, 2001 4:31 pm
by Quade
I'm not sure how to describe it. It seems very close to that used in Perl if that's any help.

RE: Using RegEx to show only RAR posts

PostPosted: Tue Jun 19, 2001 4:55 pm
by TimeOut
Are you sure? I mean, of course you're sure but I still find it hard to believe cause Perl RE is the super-super set of all REs. Would you mind, if it is ok, to reveal which RE lib you used in newsbin? Thanks for the answer and the great work!

RE: Using RegEx to show only RAR posts

PostPosted: Tue Jun 19, 2001 11:36 pm
by Quade
LAST EDITED ON 06-19-01 AT 10:37 PM (EST) ////////////////////////////////////////////////////////////////////////
// RegExp.h
//
// This code has been derived from work by Henry Spencer.
// The main changes are
// 1. All char variables and functions have been changed to char
// counterparts
// 2. Added GetFindLen() & GetReplaceString() to enable search
// and replace operations.
// 3. And of course, added the C++ Wrapper
//
// The original copyright notice follows:
//
// Copyright (c) 1986, 1993, 1995 by University of Toronto.
// Written by Henry Spencer. Not derived from licensed software.
//
// Permission is granted to anyone to use this software for any
// purpose on any computer system, and to redistribute it in any way,
// subject to the following restrictions:
//
// 1. The author is not responsible for the consequences of use of
// this software, no matter how awful, even if they arise
// from defects in it.
//
// 2. The origin of this software must not be misrepresented, either
// by explicit claim or by omission.
//
// 3. Altered versions must be plainly marked as such, and must not
// be misrepresented (by explicit claim or omission) as being
// the original software.
//
// 4. This notice must not be removed or altered.
/////////////////////////////////////////////////////////////////////////////

I've made a few mods to make it fit in a class. This is how the "Find" box is implemented. Filename and subject filters use something else which will be going away as soon as I can gut it out.

RE: Using RegEx to show only RAR posts

PostPosted: Thu Jun 21, 2001 12:49 pm
by TimeOut
Thanks a lot, that makes things very clear:)

RE: Using RegEx to show only RAR posts

PostPosted: Sun Jul 29, 2001 2:34 am
by PNPman
that all seems a bit complex
couldn't i just file filter like

noir - 0.[.]r..

to eliminate all noir - 0?.r??

the ? marks being replaced with any # value

RE: Using RegEx to show only RAR posts

PostPosted: Sun Jul 29, 2001 3:13 pm
by Quade
Yes, that looks good too.

Perhaps "[.][r-t].." because any RAR posts with more then 100 parts uses the next letter.

RE: Using RegEx to show only RAR posts

PostPosted: Sun Jul 29, 2001 4:17 pm
by dexter
Yes but you run the risk on matching other things. The "." means "Any Character", not "Any Number". To match on any number, you have to use [0-9].

RE: Using RegEx to show only RAR posts

PostPosted: Wed Aug 01, 2001 2:40 am
by PNPman
ok just need to clarify on this (Whats inside the quotations is exactly what i'm entering, not the quotation marks themselves).

Subject Filters - Reject

"Dragon" will ensure that i don't don't download any files that have the word Dragon in the Subject

File Filters - Reject

"Dragon" will also ensure that i don't download any file that have the word Dragon in the filename?

or is it exact match so i would have to use a file filter of
".*Dragon.*[.]..."

RE: Using RegEx to show only RAR posts

PostPosted: Wed Aug 01, 2001 8:34 am
by Quade
I'd think you can just use "Dragon" all by itself. I'll experiment with it to verify.