More help needed: regex for add books
There are 2 questions, question 2 being the ideal situation..
Question 1:
If the book has no series, the file format is
author - title
If it does have series, the current format is
author - [series] [series_number] title
If I use this regex
(?P<author>.+) - \[(?P<series>.+)\] \[(?P<series_index>.+)\] (?P<title>[^_]+)
it works if there is a series, but not of there isn't.
How do I fix this?
Question 2:
I would prefer file format to be
author - [series series_number] title
But what if the series name is say Oceans 11, and the book is number 3 in the series. We'd have
author - [Oceans 11 03] - title
This requires a complicated regex, which is entirely beyond me.
|