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 11-24-2020, 03:25 AM   #1
kokkie20
Junior Member
kokkie20 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2020
Device: None
Regex not working for importing books

Basic Information;
Calibre Version: 5.5
Windows 10

Issue;
I want to use the regex option in calibre when importing books.
I made up a regex (Well with help from the internet!) and want to apply it when importing ebooks.
But the regex option is just not working/ignoring the regex i apply.
It is tested online on a regex tester/debugger and there it works perfect for what it needs to do!
See here: https://regex101.com/r/dWo044/1
Let me explain some more...

I got files called as example:

#_MIST_#_... Cartoons - 02 - Dieven Cartoons.cbr
#_MIST_#_1850 - 02 - Donald.cbr

What i want the regex to do is copy the text between "#_MIST_#_" and between the first " - "
That i do with this:
(?<=^#_MIST_#_)(?P<series>[^-]+)(?=\s-)

So: #_MIST_#_... Cartoons - 02 - Dieven Cartoons.cbr
The title becomes: ... Cartoons
And for: #_MIST_#_1850 - 02 - Donald.cbr
The Title becomes: 1850

But when i click test (When i enter a file name in the regex tester in calibre included is the extension!)
It just don't add the text part to the correct textbox (In series).
Am i doing something wrong or?

Thank you in advance
kokkie20 is offline   Reply With Quote
Old 11-24-2020, 05:23 AM   #2
kokkie20
Junior Member
kokkie20 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2020
Device: None
I uploaded image to show what i try to do:


As seen on the image you see the regexp i added into the software
The regexp i gotten from "The Fourth bird" is used here.
"Bestandsnaam" is translated: filename
"Titel" is translated: title
"Reeks" is translated: serie

But as soon as i test the code it just shows the information like the image.
But what i want to show is like this. Note image is photoshopped:


On the regex tester it works perfect, but sadly on calibre it aint working.
Does anyone got a idea why and what i am doing wrong?

Last edited by kokkie20; 11-24-2020 at 05:25 AM.
kokkie20 is offline   Reply With Quote
Advert
Old 11-24-2020, 06:06 AM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
The problem is the underscores. The last line of the comment before the regex says, in English:

Quote:
Note that underscores in filenames are auto-replaced by spaces.
And for what you are trying to do, the following appears to work:

Code:
^# MIST # (?P<series>[^-]+)
davidfor is offline   Reply With Quote
Old 11-24-2020, 06:14 AM   #4
kokkie20
Junior Member
kokkie20 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2020
Device: None
Quote:
Originally Posted by davidfor View Post
The problem is the underscores. The last line of the comment before the regex says, in English:



And for what you are trying to do, the following appears to work:

Code:
^# MIST # (?P<series>[^-]+)
ill be damned, thank you that fixed it
Sometimes i wonder how stupid i realy am.... Thank you again for the quick fix!!!!
kokkie20 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing azw3 books to Kindle from calibre quit working tcreek Library Management 2 06-09-2018 08:25 AM
Regex in importing help. xd1986k Library Management 9 02-03-2015 10:42 AM
Need a regex for importing books flinkdeldinky Calibre 31 10-29-2011 08:31 AM
Regex assistance request - importing books. Belfaborac Library Management 2 10-24-2011 08:03 AM
regex Issue when Importing river Calibre 3 06-16-2009 11:03 AM


All times are GMT -4. The time now is 10:51 AM.


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