View Single Post
Old 09-12-2011, 10:59 AM   #30
joelgilb
Junior Member
joelgilb began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2011
Device: Sony PRS300
Quote:
Originally Posted by Spiffy View Post
In other words?

Yes. I THINK that works. What I've tested so far (including "L. Frank Baum - [Wizard of Oz 02] - The Marvelous Land of Oz[lit].lit ") has no problem.
Was hoping to revive this thread to ask how to add one item to this expression (from this thread, above)

Code:
^((?P<author>([^\-_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?(\[?(?P<series>[^0-9\-]+) (- )?(?P<series_index>[0-9.]+)\]?\s*-\s*)?(?P<title>[a-zA-Z1-9 ]+)
Currently my books have a few different naming conventions that the above handles the majority of.

My books tend to be names as follows:

AuthorLN, AuthorFN - Series # - Title - ISBN (lit).lit

the (lit) is not always in the filename and not all books have the ISBN in the name.

When I try to add coding to pickup the ISBN it always messes up imports when the ISBN doesn't exist. Until I saw this thread I have been using this expression and would manually remove the ISBN portion when my filename did not include the ISBN:

Code:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ?-(?P<isbn>.*)
But when I am importing books without ISBN's I get:

Title = Series #
Authors = authors
Series = No Match
Series Index = No Match
ISBN = Title


Any help would be appreciated.

Last edited by joelgilb; 09-12-2011 at 11:10 AM.
joelgilb is offline   Reply With Quote