View Single Post
Old 04-20-2010, 06:52 PM   #7
citac
Fanatic
citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.
 
Posts: 556
Karma: 1020204
Join Date: Sep 2008
Location: Bosnia and Herzegovina
Device: Lenovo Yoga Tab 2 (Android)
I tried adding parentheses around (?P<author>[^_]+) followed by a question mark, but that didn't seem to do the trick. You said I needed to add some titles for you, so here they are if you're willing to have a look.

These are all from the same author, so I want that to show up:
Beth Baker - FBI - 01 - The Games People Play
Beth Baker - FBI - 02 - The Devil’s Den
Beth Baker - FBI - 03 - Memories of the Dead

These are from various authors, about the same subject
Brothers - 01 - Reading of the Will
Brothers - 02 - Fortunate Sons
Brothers - 03 - A Matter Of Family

These two go well together:

(?P<series>.+) - (?P<series_index>\d+) - (?P<title>.*)
Brothers - 01 - Reading of the Will

If I change it to ((?P<author>[^_]+))? - (?P<series>.+) - (?P<series_index>\d+) - (?P<title>.*) it doesn't work. Did I place the parentheses and question mark in the proper place? I googled various phrases containing calibre, regex, optional author but was unable to find what I needed - all possibilities seemed very complicated and didn't achieve what I was looking for when I tried them (most of my searches pointed to this forum so I went through most of them).
citac is offline   Reply With Quote