I was annoyed by having to correct manually every time there was a hyphen in the author's name or in the title, so i continued tinkering.
I've figured it a bit more:
code
(?P<author>.*?)( -\s*(?P<series>[^_0-9]*)(?P<series_index>[0-9]*))? -\s*(?P<title>[^_].+) ?
It takes care of cases with or without hyphens in title, series & authors, with or without series.
The remaining problem is that if there is no author, series goes into the author slot.
But that is a rare occurrence, so i consider the problem mainly solved.
|