English > Support

TV-series filename structure

<< < (2/6) > >>

Lordfinarfin:
I didnt change nothing.

Do you mean this?

(?i)^.*\\(?P<title>.*)(s|\b)(?P<season>[0-9]{1,3})e(?P<episode>[0-9]{1,3})

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>\w*\b)

rick.ca:

--- Quote ---I didnt change nothing.
--- End quote ---

That's probably why it doesn't work. The regex need to be tailored to suit the filename patterns you actually use.

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>\w*\b)

...comes close to properly matching your filename pattern of...

Modern Family - 1x00 - The Bicycle Thief.avi

...but I'm not sure of the \w*\b part. I think that means "any number of word characters up to a word boundary." I suppose a space is a word boundary, and that's why you're only getting the first word of the episode title. But the purpose of this is to get the title and not whatever might be following it. You don't need that if nothing follows your titles. The ".avi" clearly marks the end of your title. But you might use other file types, so a more generalize expression for the extension would be \..{3,4}—meaning "a period followed by 3 or 4 of any character." So the full expression becomes...

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>.*)\..{3,4}

Lordfinarfin:
I found the solution >

(?i)^.*\\(?P<title>.*).?-.?(?P<season>[0-9]{1,3})x(?P<episode>[0-9]{1,3}).?-.?(?P<eptitle>[^.]+)

rick.ca:
Does my suggestion not work? Can you explain why the [^.]+ works in this case? It seems to me it means "explicitly match any character at the start of a string one or more times"—which, I suppose, matches each word in a title for however many words there are. But it's not clear to me how that leaves out the extension.

buah:
Lordfinarfin,

Because of sake of other users who might found it useful, I think it was a good idea not to open new topic but to activate old one you started, both of them upon same issue.

Considering this, I suggest to pin a topic with proven regexps for different syntax of file names. In such a topic, comments wouldn't be allowed (unlike this one): only filename -> contributed proven regexp.

I suggest this, because I think that the fact that PVD is regexp compliant application is one of the most important, yet fuzzy advantage against other inferior programs.

Any thoughts?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version