12-03-2010, 10:09 AM | #1 |
Nameless Being
|
Regular Expression Help
I have some ebooks in the format:
Scientific American - 1993.12 - Taming Africanized Killer Bees Scientific American Online - 2006 #28 - Evolution What is the correct regular expression to read all these? |
12-03-2010, 10:13 AM | #2 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
There's an introduction in the user manual.
|
Advert | |
|
12-03-2010, 10:18 AM | #3 |
Nameless Being
|
Thank you,
I sincerely can not follow these, this is well above my understanding |
12-03-2010, 11:42 AM | #4 |
Member
Posts: 21
Karma: 87
Join Date: Jan 2008
Device: Nook, EBW-1150
|
"~^Scientific American"
Include the quotes, will get you everything that starts with the words Scientific American |
12-03-2010, 11:48 AM | #5 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
I think he's looking for a regex to import them with at least title. There is no "correct" or "best" answer. He'd need to specify what metadata (author, pubdate, publisher, series name, series_index) he's trying to extract from the title to answer his question.
|
Advert | |
|
12-03-2010, 11:56 AM | #6 |
Nameless Being
|
Thanks,
How would I use it to extract the info? Scientific American - 1993.12 - Taming Africanized Killer Bees Name=Scientific American pubdate=1993.12 Title=Taming Africanized Killer Bees For the other style: Scientific American Online - 2006 #28 - Evolution Name=Scientific American Online not sure how I would store the 2006 #28 , maybe skip Title=Taming Africanized Killer Bees |
12-11-2010, 05:31 AM | #7 |
Rob Wheeler (Kent, UK)
Posts: 13
Karma: 50000
Join Date: Oct 2010
Location: Kent, UK
Device: Sony PRS-650
|
You could try...
^Scientific American.*?$ But not entirely sure from the question what you want to achieve. Could you give the original text and then the text you wamt to extract from it. |
12-11-2010, 07:00 AM | #8 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
You can't.
You can only extract Title, Authors, Series, Series index and ISBN using a regular expression as you add the book. Take a look at preferences for adding books. But if you are in luck, the files you have may have all the correct metadata embeded in them. Then you can have Calibre read it directly from inside the file. Also something you specify in preferences for adding books. |
12-15-2010, 06:21 AM | #9 |
Nameless Being
|
Do you know the regular expression that would at least give me the title?
|
12-15-2010, 06:30 AM | #10 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Using the Scientific American as series a simple one would be
Code:
(?P<series>.*) - .* - (?P<title>.*) |
12-15-2010, 06:52 AM | #11 |
Nameless Being
|
Thank you for the reply.
I tried it with "Scientific American - 1993.12 - Taming Africanized Killer Bees" as test. It recognises "Scientific American - 1993" as title and for the series it gets no match. |
12-15-2010, 07:14 AM | #12 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Try
Code:
(?P<series>.*?) - .*? - (?P<title>.*?) |
12-15-2010, 07:16 AM | #13 | |
Grand Sorcerer
Posts: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
You probably didn't perform the secret handshake. For the tests to work, you must have a file extension on your file name. |
|
12-15-2010, 07:17 AM | #14 |
Nameless Being
|
Yes it works!
I did not know about the handshake! Last edited by iKarampa; 12-15-2010 at 07:20 AM. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regular Expression Help | Azhad | Calibre | 86 | 09-27-2011 02:37 PM |
Regular Expression Help | smartmart | Calibre | 5 | 10-17-2010 05:19 AM |
Need Help Creating a Regular Expression | Worm | Calibre | 9 | 08-18-2010 01:20 PM |
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 |