View Single Post
Old 06-04-2016, 08:51 PM   #1
jecilop
Addict
jecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day now
 
Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
Help needed- RegExp for filename to metadata when adding books

SOLVED as of Post #4.

Hello,

The default regular expression for getting metadata from filenames on import is:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ?

I have tried adjusting this, but I cannot get it right. Searches related to my problem do not yield the needed answer.
I am trying to import filenames of the following format and want them to fill in the obvious fields.

John Doe - [Narnia World 01] - The Book's Name.epub

The test with the default expression above just yields the author with the rest as the filename. My adjustments result in invalid expressions or incorrect imports.

Can someone share the tweek to this so that files of this format will import as desired? Also, I'm hoping the adjustment will leave the following format as desired on import despite using a single regular expression.
John Doe - The Other Book's Name.epub


So using ONE regular expression for a group of files to be added:
The first book will import 4 types of metadata (author, series, series index, title).
The second book will import only 2 (author and title).

Help is definitely appreciated. I feel like what is default should work for this, but I get the symbols jumbled. I had a pretty good handle on regular expression awhile back, but I think I have to start over :-(

Attached is a screenshot of the Adding Books window showing the test with the default expression.
Attached Thumbnails
Click image for larger version

Name:	Transform title to metadata.JPG
Views:	143
Size:	59.3 KB
ID:	149201  

Last edited by jecilop; 06-07-2016 at 06:47 PM. Reason: Updated-Solved.
jecilop is offline   Reply With Quote