English > Support
File Scanner and Regular Expressions
nostra:
Nostra, are any fields other than title, season, episode and eptitle supported. For example, can I make an expressions to capture things like year, director, rating from filenames?
You can only get title, original title, episode title, season number, episode number, and year.
(There is a bug in the current version that produces wrong results when getting original title without title)
P.S. Your observations above are perfectly right ;)
patch:
--- Quote from: nostra on February 21, 2009, 04:02:02 pm ---Have you took a look at the link I provided above: http://www.regular-expressions.info/tutorial.html
--- End quote ---
Thanks for the reference, I also looked at http://en.wikipedia.org/wiki/Regex for a more concise but cryptic explanation.
Decided my two main series search patterns should be
(?i)^.*\\(?P<title>[^\\]*?)\bs(?P<season>[0-9]{1,2})[ .x]{0,2}e(?P<episode>[0-9]{1,2})\b[ .-]*(?P<epititle>[^\\]*)$
(?i)^.*\\(?P<title>[^\\]*?)[ .-]*\b(?P<season>[0-9]{1,2})x(?P<episode>[0-9]{1,2})\b[ .-]*(?P<epititle>[^\\]*)$
They basically look for a file name containing text of the form "s11e11" or "11x11" bounded by word boundaries. Where the s11 & e11 can be separated by " ", "-" or "x"
I usually store my TV series in the format
Title\s1\episode file
So I precede the above by directory structure searches i.e. Look for “Title\s1\” and use this data in preference. File names are searched from more to less stringent formats i.e. Look for “Title\s1\” with file name formats
text s0e00 episode title
text 00x00 episode title
Text 0 optional not digit 00 episode title (digit but not word boundary required)
text 00 episode title
My regex for which are
(?i)^.*\\(?P<title>[^\\]*)\\s(?P<season>[0-9]{1,2})\\[^\\]*?\bs([0-9]{1,2})[ .x]{0,2}e(?P<episode>[0-9]{1,2})\b[ .-]*(?P<epititle>[^\\]*)$
(?i)^.*\\(?P<title>[^\\]*)\\s(?P<season>[0-9]{1,2})\\[^\\]*?\b[0-9]{1,2}x(?P<episode>[0-9]{1,2})\b[ .-]*(?P<epititle>[^\\]*)$
(?i)^.*\\(?P<title>[^\\]*)\\s(?P<season>[0-9]{1,2})\\[^\\]*?(?<![0-9])[0-9]{1,2}[^\\0-9]*(?P<episode>[0-9]{2})(?![0-9])[ .-]*(?P<epititle>[^\\]*)$
(?i)^.*\\(?P<title>[^\\]*)\\s(?P<season>[0-9]{1,2})\\[^\\]*?(?<![s0-9])(?P<episode>[0-9]{2})(?![0-9])[ .-]*(?P<epititle>[^\\]*)$
Hope this helps some others despite the fact it is not yet working 100% as expected
Edit
regex updated
patch:
Residual problems
For file / path "G:\Video - TV Series\Tripping the Rift\s2\Tripping.The.Rift.S02E02.You.Wanna.Put.That.Where.DVDRip.avi"
PVD using the Regex by path or file name -> series name "ping the Rift" or "ping The Rift" respectively but I suspect that is a problem with the replace function
epititle doesn't seam to do anything
By the way
The best way I have found to get these regex working is to make a text file with examples of all the common and hard names you are trying to recognise.
Open this file with Edit Pad Pro
Copy each regex into the search window (it colours them for you to show the meaning of each character in the regex, helping find syntax errors)
Search your test file with the expression to make sure it does what you expect.
rick.ca:
--- Quote ---I suspect that is a problem with the replace function
--- End quote ---
Wouldn't that be the (?i).?((?<!\b).){0,5}Rip replacement at work?
Yes, it appears epititle doesn't work.
I found a bug while playing with the replacement function...
Attempting to change the order of any of the replace expressions using the up/down arrows results in the error:
Unexpected exception:
The source tree must contain the source node. (C:\Program Files\Virtual Treeview\Source\VirtualTrees.pas, line 26510)
The program becomes completely unresponsive—it has to be killed.
I was able to remove an expression, but adding one results in the error (after saving and reopening Preferences):
Unexpected exception:
List index out of bounds (8 )
On restarting the program, it's apparent the configuration file is corrupted, as settings are not recognized. I recovered by replacing the FindExps= line with one from backup.
nostra:
I could not find any problems with the replace function and <epititle> works here as well. Could you explain how to reproduce the problem with eptitle?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version