View Single Post
Old 12-04-2010, 12:35 AM   #2
thrawn_aj
quantum mechanic
thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.thrawn_aj ought to be getting tired of karma fortunes by now.
 
thrawn_aj's Avatar
 
Posts: 705
Karma: 483827
Join Date: Aug 2010
Location: NorCal
Device: Nook1, Samsung Transform, Nook2
How about this?

Code:
(?P<title>.+) by (?P<author>.+) at (?P<publisher>.+) - (?P<ISBN-10>.+) - (?P<ISBN-13>.+)\.pdf
Note1: I added the \.pdf as an example. Be sure to add the file extension you have or the search will fail even if the rest of the regex is correct (maybe that was your problem?).

Note2: I suspect that this will fail dramatically if <title> contains "by" as a separate word.

Note3: I don't recall the actual labels for the 2 isbn fields. My (possibly obsolete) knowledge of this tells me that only 1 isbn field is supported. Dunno how far custom metadata has come. Assuming that isbn-13 is not usable, this is what I would do:

Code:
(?P<title>.+) by (?P<author>.+) at (?P<publisher>.+) - (?P<isbn>.+) - ([0-9]+)\.pdf
(if you want to save the ISBN-10 and throw away the ISBN-13. Make appropriate changes if you want it the other way round).

If custom metadata fields are supported (I just don't know), the following might work:

Code:
(?P<title>.+) by (?P<author>.+) at (?P<publisher>.+) - (?P<isbn>.+) - (?P<isbn13>.+)\.pdf
(if you want to save the ISBN-10 to the normal Calibre ISBN field and the ISBN-13 to a custom field called "isbn13" - it has to exist of course).

It doesn't help that I'm at work and don't have Calibre in front of me to check this. Good luck though
thrawn_aj is offline   Reply With Quote