Quote:
Originally Posted by ejjenkins
I have read through most of the threads for Calibre and regular expressions, I am at a loss.
I have a lot of books that are all saved in the exact same format and I want to be able to extract the metadata from the filenames. Here are a couple of examples:
Adams, Robert,Castaways In Time,01,Castaways in Time.txt
Anderson, Kevin J.,Game Earth,01,Game Earth.txt
All of them are: Author Last Name, First Name, Series Name, Series Index, and Title
If there is no series or series index, the comma will still be there, for example:
Aldiss, Brian W.,,,The Dark Light Years.txt
Anderson, Poul,,,Brainwave.txt
I know this is probably pretty easy and straightforward, but I can't seem to get my brain around this.
|
Try this regex:
^(?P<author>([^,]+,[^,]+)),(?P<series>[^,]*),(?P<series_index>[^,]*),(?P<title>[^,]*)