Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 07-30-2018, 01:42 AM   #1
sealbeater
Banned
sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.
 
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.
sealbeater is offline   Reply With Quote
Old 07-30-2018, 01:45 AM   #2
sealbeater
Banned
sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.
 
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?
sealbeater is offline   Reply With Quote
Advert
Old 07-30-2018, 02:00 AM   #3
sealbeater
Banned
sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.sealbeater ought to be getting tired of karma fortunes by now.
 
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...
sealbeater is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 03:29 PM.


MobileRead.com is a privately owned, operated and funded community.