View Single Post
Old 07-09-2009, 10:31 PM   #136
ziplizard
Enthusiast
ziplizard doesn't litterziplizard doesn't litter
 
Posts: 45
Karma: 142
Join Date: Feb 2009
Device: Kindle 2.0
Regular Expressions help!

All of my eBooks are 'Last Name, First Name - Title' (or 'Last Name, First Name - Series ## - Title').

My current regex is:
(?P<author>((?!\s-\s).)*)\s- (?P<title>.*)

This gives me:
Author = 'Last Name, First Name'
Title = 'Title' or 'Series ## - Title'

Title is what I want. Author is backwards. Is there any way to make <author> be something like <author-sort> or <author-last>,<author-first>. I know nothing of python or regex and everything I've done was with searching around mobileread and guess&check so feel free to talk to talk down to me.

Also, why isn't there a nice list of popular regex on the Calibre site? I would think that would be very FAQ-ish.
ziplizard is offline