View Single Post
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