regular expression

Other platforms, generic questions.
Post Reply
dsplzion

regular expression

Post by dsplzion »

Can some regular expression expert please tell me what expression I could use to download the TV show called "From" without getting every single tv show that starts with the word From? Like "From Scratch" came up today. I have tried to create an expression and tested it on an online tester but it didn't work in qbittorrent so I'm asking for help. Thank you very much in advance.

The ones I want look like this:

From S01E10 XviD-AFG

the one I got that I didn't want looked like this:

From Scratch 2022 S01E07 XviD-AFG

thanks again.

d
User avatar
Peter
Administrator
Administrator
Posts: 2694
Joined: Wed Jul 07, 2010 6:14 pm

Re: regular expression

Post by Peter »

dsplzion wrote: Sat Oct 22, 2022 5:30 am...
I am anything but an expert...

So regex is not that hard (says the person who never mastered it).
Basically...

Code: Select all

From S01.*
- It just means "From S01" is a 1:1 match, and then .* means any character can follow.
- So anything that starts with "From S01" will match.
If you give more examples, I'll try to post more to show how it works.


If you want the next season when it comes out from.. "From", then you can do:

Code: Select all

From S[0-9]+.*
This means:
- "From S" start
- [0-9] numbers and there is a + after the "group", which means one or more of these 0-9 numbers (ie.: S01, S1, S99)
- and finally: .* - which will match any other character

If you want only from this AFG group:

Code: Select all

From S[0-9]+.*AFG.*
This means:
- "From S" start
- [0-9] numbers and there is a + after the "group", which means one or more of these 0-9 numbers (ie.: S01, S1, S99)
- then .* which just means anything can come now
- AFG: the group you want
- .* to finish it, because there might be anything after
dsplzion

Re: regular expression

Post by dsplzion »

Thank you. I'll try that. It seems like it will work.

d
Post Reply