Sample Filter

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

Sample Filter

Postby nagelfetisch » Sun Oct 01, 2006 2:40 pm

Hi

What i'd like to create is a sample filter(subject filter) for mp3 groups.
What i did is the following:create an mp3 filter entry and then search for "01",only the first track,but that always leaves me with some posts like:2001,....
and in addition to that i wouldn't be able to auto-download them.
!.*1DX does work as an accept filter for picture index files though,i found it somewhere here in this forum,but doesn't for the sample filter i'd like to create.
Thanks

EDIT:i guess the answer is no,there is no such filter :)

EDIT:the answer is yes,there is such a filter
Last edited by nagelfetisch on Mon Oct 09, 2006 5:40 pm, edited 1 time in total.
nagelfetisch
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Thu Feb 23, 2006 2:49 pm

Registered Newsbin User since: 05/15/06

Postby bobkoure » Mon Oct 09, 2006 3:05 pm

Not really clear what you're doing, but on the off chance that I've guessed correctly - you can use \d for " numeric character" and [^\d] for " anything but a numeric character), so [^\d]01\.mp3 would match 01.mp3, but not 2001.mp3. If you want to allow more than one leading zero, try [^\d]0+1\.mp3 - with "+" meaning "one or more" - so 00001.mp3 should match as well.
bobkoure
 

Postby nagelfetisch » Mon Oct 09, 2006 5:38 pm

[^\d]01 works and leaves me with just the two smallest par2 files in addition to the first track and ~3 albums in the indie mp3 group-GREAT :D

[^\d]01\.mp3 + [^\d]0+1\.mp3 filter out everything but one single song
[^\d]0+1 does work too though,leaves me with 7 more files than [^\d]01

Thanks 8)
nagelfetisch
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Thu Feb 23, 2006 2:49 pm

Registered Newsbin User since: 05/15/06

Postby bobkoure » Mon Oct 09, 2006 7:52 pm

[^\d]0+1 does work too though,leaves me with 7 more files than [^\d]01

Glad it helped!

But files like 001.mp3 and not 2001.mp3, yes?
You can control the number of accepted matches with {}
[^\d]0{1,2}1
means "one or two zeros.
bobkoure
 

Postby nagelfetisch » Mon Oct 09, 2006 9:44 pm

But files like 001.mp3 and not 2001.mp3, yes?

Yep.Before,files posted like:

### (2001) [01/20] - "####-#### - 01 - ###.mp3"

weren't filtered at all,the whole album was still there,whereas now,everything but the first track of a series of files posted this way is filtered out.
nagelfetisch
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Thu Feb 23, 2006 2:49 pm

Registered Newsbin User since: 05/15/06


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 2 guests