![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2010
Device: ipad iphone
|
![]()
Being a non programmer and after having searched I have not been able to compile a regular expression structure that covers the following file format
<Title> by <Authors> at <Publisher> - <ISBN-10> - <ISBN-13> Help would nice Thanks in advance Kren |
![]() |
![]() |
![]() |
#2 |
quantum mechanic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 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 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 It doesn't help that I'm at work and don't have Calibre in front of me to check this. Good luck though ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Note 1 to note 1: I don't think you need to add any extensions to the import regexes. From what I recall, Calibre automatically strips the extension from the filename, thus the regex never even seees the extension.
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2010
Device: ipad iphone
|
![]()
Gentlemen,
thanks for your input - it works except for the publisher - why I don't know Kren ![]() |
![]() |
![]() |
![]() |
#5 | |
quantum mechanic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 705
Karma: 483827
Join Date: Aug 2010
Location: NorCal
Device: Nook1, Samsung Transform, Nook2
|
Quote:
The official manual explicitly warned about this so I figured that's what was tripping up OP's initial trials. Unfortunately, after reading it again, I see that I misread the last line - it was merely talking about the test filename, not the real one ![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
Tags |
regular expression |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regular Expression Help | Azhad | Calibre | 86 | 09-27-2011 02:37 PM |
Regular Expression Help | iKarampa | Calibre | 13 | 12-15-2010 07:17 AM |
Regular Expression Help | smartmart | Calibre | 5 | 10-17-2010 05:19 AM |
Help with the regular expression | Dysonco | Calibre | 9 | 03-22-2010 10:45 PM |
I don't know how to use wilcards and regular expression.... | superanima | Sigil | 4 | 02-21-2010 09:42 AM |