Regex 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
firekidop
Newbie
Newbie
Posts: 18
Joined: May 20th, 2019, 5:17 pm

Regex help please

Post by firekidop »

I set accept

Code: Select all

re:^(Survivor)+.S*
if i am not wrong basically name start from Survivor.S. however sabnzb downloaded a release name "Survivor.Za.S08E07.720p.WEB-DL.AAC2.0.H.264-BTN"

any idea how to solve the problem? does "+.S*" ignoring?
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Regex help please

Post by sander »

what is the problem?

so: what do you want to download, and what not? Examples please.

Your current regex

re:^(Survivor)+.S*

says something like:
from beginning of line
Survivor
happens at least once
then anything
then a S
then anything

... so Survivor.Za.S08E07.720p.WEB-DL.AAC2.0.H.264-BTN fits that: starts with Survivor, and there is a S somehwere
firekidop
Newbie
Newbie
Posts: 18
Joined: May 20th, 2019, 5:17 pm

Re: Regex help please

Post by firekidop »

oh my bad. here is what i want to download.

Survivor.S01E14.AMZN.WEB-DL.AAC2.0.H.264-AJP69

i want to download after Survivor keyword if there is .S. kindly help please.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Regex help please

Post by sander »

Did you try

^Survivor\.S

in a regex, a dot "." means "anything".
if you want a real, use "\."
firekidop
Newbie
Newbie
Posts: 18
Joined: May 20th, 2019, 5:17 pm

Re: Regex help please

Post by firekidop »

thnak you so much. it's working fine. just a confirmation, can i use following regex for multiple keyword? i tested and it seems working fine.

Code: Select all

re:^(Monsters.at.Work|Survivor)\.S
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Regex help please

Post by sander »

I think that works.

... and, again: Monsters.at.Work will also match MonstersFatyWork

This is a nice online tool: https://pythex.org/?regex=%5E(Monsters. ... &verbose=0
firekidop
Newbie
Newbie
Posts: 18
Joined: May 20th, 2019, 5:17 pm

Re: Regex help please

Post by firekidop »

thank you so much for the regex replace testing link. one more help please.

for this one what will be the correct regex?

Code: Select all

UFC.264.1080p.WEB-DL.H264.Fight-BB 
this one is working fine, just want to confirmation if it can be conflict with others.

Code: Select all

^(UFC)\.[0-9]
User avatar
jcfp
Release Testers
Release Testers
Posts: 986
Joined: February 7th, 2008, 12:45 pm

Re: Regex help please

Post by jcfp »

That would work, although you don't need the parenthesis and you could be extra strict by requiring that the number after "UFC" is followed by another dot, e.g.:

Code: Select all

^UFC\.[0-9]+\.
Another nice site for this stuff is https://regex101.com/ (be sure to select 'python' as the regex flavour), it will also explain what everything does.
Post Reply