View Single Post
Old 07-01-2013, 05:08 PM   #13
parkher
Evangelist
parkher ought to be getting tired of karma fortunes by now.parkher ought to be getting tired of karma fortunes by now.parkher ought to be getting tired of karma fortunes by now.parkher ought to be getting tired of karma fortunes by now.parkher ought to be getting tired of karma fortunes by now.parkher ought to be getting tired of karma fortunes by now.parkher ought to be getting tired of karma fortunes by now.parkher ought to be getting tired of karma fortunes by now.parkher ought to be getting tired of karma fortunes by now.parkher ought to be getting tired of karma fortunes by now.parkher ought to be getting tired of karma fortunes by now.
 
Posts: 467
Karma: 369018
Join Date: Nov 2010
Device: BL Alita/Mimas/Ares, OB Note2/Note, KA One/H2O/HD, S PRS T2/T1, PB 902
Turns out, the previous regular expression does not handle fractional series numbers.
Such as:

Budung Kuleeeee - [Silly Horror 2.5] - Horror Horror Hor. epub

Also a fix so that the last letter of the title is not moved to Publisher in the case when the title is the very last part of the file name.

Here is the fixed one:

(?P<author>[^_-]+) -?\s*(\[|\()?\s*(?P<series>[^_0-9\[\(-]*)(?P<series_index>[0-9.]*)\s*(\]|\))?\s*-\s*(?P<title>[^_\[\(]+)\s*(?P<publisher>[^$]*)\s* ?


Still currently not supported:

when the name of the series itself contains a number followed by the series number:

Some Author - [Series Name Contains Number 21 02] - Title.rar

when the series name and numer are separated by a dash, so we have already three dashes:

Some Author - Some Series - 16 - Some Title.rar

Last edited by parkher; 07-01-2013 at 05:49 PM.
parkher is offline   Reply With Quote