12-18-2010, 12:31 PM | #1 |
Junior Member
Posts: 6
Karma: 10
Join Date: Dec 2010
Device: Calibre
|
Adding Books, regular expression
First of all, I am very happy I found Calibre; it made my ebook collection organization so much better~
I am trying to figure out how to edit the regular expression for adding metadata using the filename. I know there are a lot of post regarding this but none of them works for me (either I'm not pasting it right or I'm just stupid and need someone to walk me through the steps~) I currently have this: (?P<author>[^_]+)-(?P<series>.+) (?P<series_index>.+)-(?P<title>.+) which works GREAT when I have series in between the author and title. ie Name_Name-Series_##-Title_title_tile.ext (works with or without "_") What I would like is for it to recognize files without the series ie Name_Name-Title_title_tile.ext and at the same time recognize those with series if present... any possibilities? Thanks in advance!! |
12-18-2010, 03:49 PM | #2 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Yes. Make the series optional. If you want someone to write the regex for you, post one sample of each type filename it needs to parse. Without sample filenames, it's very hard to match what you need.
|
Advert | |
|
12-18-2010, 05:32 PM | #3 | |
Junior Member
Posts: 6
Karma: 10
Join Date: Dec 2010
Device: Calibre
|
Quote:
Suzanne Brockmann - Troubleshooters 13 - Into the Fire.rtf Suzanne Brockmann - Into the Fire.rtf It would be cool if Calibre can recognize the title ("into the fire") and author ("Suzanne brockmann), with option of detecting series ("Troubleshooters", series index "13") only if it's there Thanks again!! |
|
12-18-2010, 06:22 PM | #4 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Read this thread, the regex matches exactly what you want.
|
12-19-2010, 08:18 AM | #5 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Kiwidude sent you to a regex that will do that. There are many around that will not only do those, but will also do variations, such as where the series number has a '#' symbol in front, etc. searches on "regex" here will find them.
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre book adding: Regular expression request... | Spiffy | Calibre | 34 | 01-19-2016 01:03 PM |
Regular Expression Help | iKarampa | Calibre | 13 | 12-15-2010 07:17 AM |
Regular Expression on adding books. | Lokro | Calibre | 4 | 11-06-2010 11:05 AM |
Regular Expression For Adding Books | jhart711 | Calibre | 3 | 09-27-2010 06:51 AM |
Helping importing books using regular expression | askyn | Calibre | 4 | 05-08-2010 01:06 AM |