View Single Post
Old 04-17-2011, 10:48 PM   #18
Justy
Fanatic
Justy has much to be proud ofJusty has much to be proud ofJusty has much to be proud ofJusty has much to be proud ofJusty has much to be proud ofJusty has much to be proud ofJusty has much to be proud ofJusty has much to be proud ofJusty has much to be proud ofJusty has much to be proud ofJusty has much to be proud of
 
Justy's Avatar
 
Posts: 527
Karma: 27417
Join Date: Dec 2007
Location: Greater Vancouver Area, BC, Canada
Device: Nexus 7, Sony prs-t1, Kobo Glo
I feel kind of silly asking for help on this same issue again. I found more files to import and these 2 pieces of code which both worked at various times in the past are not giving the expected results now. I suspect that Calibre has changed a bit with all the wonderful updates Kovid & team have been adding for us.

Quote:
Originally Posted by user_none View Post
This will work provided there are no numbers in the series name:
Code:
[^_]+_(?P<author>[^_]+)_((?P<series>[^_\d]+)(?P<series_index>\d+)?_)?(?P<title>[^_]+)
Quote:
Originally Posted by Starson17 View Post
Try this:
Code:
([^_]+ )(?P<author>[A-Za-z]+) ((?P<series>[^_\d]+)(?P<series_index>\d+)? )?(?P<title>[^_]+)
My test file names were:
  1. Genre_AuthorLastName_Title.prc
  2. Genre_AuthorLastName_Series01_Title.prc
which gave the following results respectively:
  1. Title = Genre AuthorLastName Title
  2. Title = Genre AuthorLastName Series01 Title
Justy is offline   Reply With Quote