Page 1 of 1

Regex RSS filter

Posted: October 12th, 2009, 5:51 pm
by Ramrodian
Either I'm too tired or I'm just haven't enough brain to think straight.
I'm trying to figure out how regular expressions work.

I was using just standard word filtering, but it wasn't really satisfying.
This is for mostly TV shows.
I'm trying to use regular expressions now and it seem to match my filters, but only if it is a one word show.
For example:
re:^Merlin
re:^Desperate?Housewives

It match: Merlin.s0?x?? and Merlin.Secrets* but it doesn't seem to match Desperate.Housewives.*

Not even if I use re:^Desperate*Housewives as the filter string.
Am I doing anything wrong?

Another question is that I've tried to figure out for a day now, if there is a way to use regular expressions in a easy way to accept one thing in a releasename but reject another, for example for Merlin.
I only want the regular show of Merlin, but not the Merlin.Secrets.And.Magic show, is there a way to use the same filter line to filter the both at the same time, if you understand what I mean. Or do I need to make a seperate reject filter for the Secrets And Magic releases?

Re: Regex RSS filter

Posted: October 12th, 2009, 6:18 pm
by c0ld
Ramrodian wrote: Either I'm too tired or I'm just haven't enough brain to think straight.
I'm trying to figure out how regular expressions work.

I was using just standard word filtering, but it wasn't really satisfying.
This is for mostly TV shows.
I'm trying to use regular expressions now and it seem to match my filters, but only if it is a one word show.
For example:
re:^Merlin
re:^Desperate?Housewives

It match: Merlin.s0?x?? and Merlin.Secrets* but it doesn't seem to match Desperate.Housewives.*

Not even if I use re:^Desperate*Housewives as the filter string.
Am I doing anything wrong?
? and * don't mean wildcards, they stand for 'consecutive instances of the previous group or character' which in this case would be 'DesperateeHousewives'.
. and .* are the wildcards. A single period is for a single wildcard, and the single period plus the 'consecutive instances' qualifier obviously means more than one wildcard. So try this;
re:^Desperate.Housewives.*
Another question is that I've tried to figure out for a day now, if there is a way to use regular expressions in a easy way to accept one thing in a releasename but reject another, for example for Merlin.
I only want the regular show of Merlin, but not the Merlin.Secrets.And.Magic show, is there a way to use the same filter line to filter the both at the same time, if you understand what I mean. Or do I need to make a seperate reject filter for the Secrets And Magic releases?
I would reject the longer name first, then accept the short name later. Just be very specific with the first reject filter.

Re: Regex RSS filter

Posted: October 12th, 2009, 6:46 pm
by Ramrodian
c0ld wrote: ? and * don't mean wildcards, they stand for 'consecutive instances of the previous group or character' which in this case would be 'DesperateeHousewives'.
. and .* are the wildcards. A single period is for a single wildcard, and the single period plus the 'consecutive instances' qualifier obviously means more than one wildcard. So try this;
re:^Desperate.Housewives.*

I would reject the longer name first, then accept the short name later. Just be very specific with the first reject filter.
Thank you!
And for Merlin I made it easy for me, I used re:^Merlin.S0* instead  ;D

Re: Regex RSS filter

Posted: October 12th, 2009, 6:57 pm
by c0ld
Thank you!
And for Merlin I made it easy for me, I used re:^Merlin.S0* instead  ;D
Careful, re:^Merlin.S0* would match Merlin.S0, Merlin.S00, Merlin.S000, etc. Whereas re:^Merlin.S0.* would match Merlin.S01, Merlin.S02, Merlin.S03, etc. I doubt it'll actually matter though.