RSS Python regular expressions help please

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
User avatar
Turnip
Release Testers
Release Testers
Posts: 5
Joined: November 6th, 2009, 11:42 pm

RSS Python regular expressions help please

Post by Turnip »

Hi,
Trying to filter RSS say "12" and not wanting anything but that number, ie no E12 or S12 (I know I can use Reject for those).
How do I express the filter in Python? I have tried to get my head around it but cannot work it out, I get confused. I blame my age :-)
I know I need to start the filter with;  're:' but it's the what comes after that I stumble on, I can't seem to get the string right.  ???
Appreciate if I could get some help with this.

Cheers,
T
Better to ask a stupid question and appear ignorant than to remain silent and be stupid.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: RSS Python regular expressions help please

Post by shypike »

If you want an isolated 12, like in "bla 12 bla", you could use this:

re:\D*12\D*

or

re: [^0-9]*12[^0-9]*

This means: zero or more non-digits, then "12", then zero or more non-digits.
User avatar
Turnip
Release Testers
Release Testers
Posts: 5
Joined: November 6th, 2009, 11:42 pm

Re: RSS Python regular expressions help please

Post by Turnip »

Great,

Thanks heaps - I got it now! I was almost on the right track. Off to learn Python :-)

Cheers
T
:)
Better to ask a stupid question and appear ignorant than to remain silent and be stupid.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: RSS Python regular expressions help please

Post by shypike »

Post Reply