View Single Post
Old 08-29-2011, 03:24 PM   #8
hanbalfrek
Junior Member
hanbalfrek began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Aug 2011
Device: Nook Color
Quote:
Originally Posted by dwanthny View Post
What regex are you using for import?

I use the following regex under Preferences - Adding Books for importing books with the author first.

Code:
^((?P<author>([^\-_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?((?P<series>[^0-9\-]+)(\s*-\s*)?(?P<series_index>[0-9.]+)\s*-\s*)?(?P<title>[^\-_0-9]+)
It works on the books you gave as an example.

Good Luck.
Hey dwanthny,

Thanks for the last one. I got another one for you.

I have another directory of books that go

Rim Change - A. Bertram Chandler - Grimes 046

and I've modified your code to get title and author, but can't get series/index.


I changed it to
Code:
^(?P<title>[^\-_0-9]+)(\s*-\s*)((?P<author>([^\-_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?((?P<series>[^0-9\-]+)(\s*-\s*)?(?P<series_index>[0-9.]+)\s*-\s*)?
test-A. Bertram Chandler - Grimes 046.pdf

becomes
Title: test
Authors: A. Bertram Chandler
Series: No match
Series index: No match

Thanks again!
hanbalfrek is offline   Reply With Quote