Page 1 of 1

Regex help please

Posted: July 16th, 2021, 6:50 am
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?

Re: Regex help please

Posted: July 16th, 2021, 7:57 am
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

Re: Regex help please

Posted: July 16th, 2021, 10:33 am
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.

Re: Regex help please

Posted: July 16th, 2021, 11:24 am
by sander
Did you try

^Survivor\.S

in a regex, a dot "." means "anything".
if you want a real, use "\."

Re: Regex help please

Posted: July 16th, 2021, 12:04 pm
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

Re: Regex help please

Posted: July 16th, 2021, 12:21 pm
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

Re: Regex help please

Posted: July 17th, 2021, 6:28 am
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]

Re: Regex help please

Posted: July 17th, 2021, 8:20 am
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.