I am using a frontend (Media Portal with TV-Series plug-in) for my home theater pc and I keep tv shows on it...My filenames are setup as: <series>\S<season>\filename.extfor filename ... all i want to get from it is the episode & extensionpossible filenames:group-blah101.avishow.name.s01e03.720p.hdtv.x264-group.mkvshow.name.1x03.pdtv.xvid-group.mkvi was thinking get the first set of numbers... if it's 3+ numbers, take the last 2 as <episode>if it is e{2}, take thatif it's x{2}, take that^<series>[\\]S(?<season>[0-2]?\d)[\\]*?(?:s(?<season>[0-2]?\d)e(?<episode>\d\d)|(?<season>(?:[0-2]\d|(?<!\d)\d))x?(?<episode>\d\d))(?!\d)(?:[ .-]?(?:s\k<season>e?(?<episode2>\d{2}(?!\d))|\k<season>x?(?<episode2>\d{2}(?!\d))|(?<episode2>\d\d(?!\d))|E(?<episode2>\d\d))|)[ -.]*\.(?<ext>[^.]*)$That works for everything but when the show name is not in the filename and only in the first directory. so i'd rather grab <series> from the first directory and ignore the show name completely and move on to the <season> and <episode> that follows.[Edited on May 14, 2008 at 9:56 PM. Reason : code]
5/14/2008 9:56:25 PM
You do realize processing time increases exponentially with the complexity of the test pattern right?Make 1, 2,5, or however many and test in order of priority til you get a match.i.e. match against [ignore this crap] s(digits)e(digits) [ignore this crap greedy] period charactersif that fails try the 1x03 test. Then rename all your shit to something that makes sense.
5/16/2008 10:37:11 PM