Quote:
Originally Posted by ilovejedd
Either
(?P<author>.+?) - (\[(?P<series>.+?) (?P<series_index>[0-9]+)\] - )?(?P<title>.+)
or
(?P<author>.+?)( - (\[(?P<series>.+?) (?P<series_index>[0-9]+)\])? - (?P<title>.+)
would work. If you don't have any filenames with series information, then the following might be simpler:
(?P<author>.+?) - (?P<title>[^_]+)
|
No, none of these work. The first 2 don't parse out the author and title at all. The "simple" one is close, but always truncates the last word of the title.
Maybe I'm not making myself clear. This should be a very simple string operation. Except, apparently, in Python. I want everything to the left of the leftmost hyphen to be the author. Everything to the right of the leftmost hyphen, including other hyphens, is the title. For example, if the filename is
Aaaaaaa, Bbbbb - Qqqqqqq Rrrrr - Sssssssss Ttttttttt.pdf
the author is Aaaaaaa, Bbbbb
the title is Qqqqqqq Rrrrr - Sssssssss Ttttttttt
Thanks again,
Bob