![]() |
#1 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 666
Karma: 1752814
Join Date: Jan 2008
Device: Sony Reader PRS-505 : Onyx Boox Max : Sony PRS-900 : Onyx Kepler Pro
|
Adding books, need regex help
So, I'm getting ready to add some books and I'm working on my regex and it's almost there but not quite right. Book filename format is as follows:
Stephen King - [The Shining #2] - Doctor Sleep (2013) [9781476727660].azw3 This is my regex (?P<author>[^_-]+) -?\s*\[(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\] - (?P<title>[^_-]+) \((?P<published>[^_-]+)\) \[(?P<isbn>.+)\] I'm getting matches on all my fields but I have one question. My Series field shows: The Shining # How can I remove that "#"? I feel like I did earlier but I forgot how. Last edited by sealbeater; 07-30-2018 at 01:46 AM. |
![]() |
![]() |
![]() |
#2 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 666
Karma: 1752814
Join Date: Jan 2008
Device: Sony Reader PRS-505 : Onyx Boox Max : Sony PRS-900 : Onyx Kepler Pro
|
On that note, I notice my regex doesn't work if there isn't a series field handy.
Stephen King - The Road Virus Heads North (2006) [1608479730].mobi fails. How do people get around that? |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 666
Karma: 1752814
Join Date: Jan 2008
Device: Sony Reader PRS-505 : Onyx Boox Max : Sony PRS-900 : Onyx Kepler Pro
|
Figured it out!
(?P<author>[^_-]+) -?\s*\[(?P<series>[^_0-9-]*)#(?P<series_index>[0-9]*)\] - (?P<title>[^_-]+) \((?P<published>[^_-]+)\) \[(?P<isbn>.+)\] Second question applies, do you just keep multiple templates? I guess I only need two... |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding Books - Filename Regex Management | Paulie_D | Library Management | 4 | 05-10-2015 01:03 PM |
Adding books - filename RegEx author FN (initials) LN | Rob557 | Library Management | 8 | 10-16-2014 04:53 PM |
regex for filename with muliple dots? (adding books) | kite | Library Management | 5 | 09-28-2014 09:09 AM |
Adding books - regex help | tonyx3 | Library Management | 1 | 03-13-2013 08:21 AM |
A little help adding books and using regex. | Dragonator | Calibre | 7 | 12-17-2010 06:57 PM |