View Single Post
Old 07-06-2009, 08:32 PM   #3
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
The following regex will match both cases provided they're no _ within each section.

Code:
[^_]+_(?P<author>[^_]+)_((?P<series>[^_]+)_)?(?P<title>[^_]+)
At least it matches your Genre_AuthorLastName_Series_Title and Genre_AuthorLastName_Title examples.
user_none is offline   Reply With Quote