I've hit a wall with this regex and i'm hoping someone might have the answer.
Goal:
1. Fix Library Order Titles back to Normal Title Order where the article has been thrown to the back of the title separated by a space and a comma
2. Ignore Titles that are groups of words separated by a comma that are not library order titles.
3. leave any bracketed info in place.
4. articles can be upper or lower case
Definitions:
Library Order = Titles that begin with an article have been swapped so that the article is on the tail end separted with a comma
Article = "A", "An", or "The" and is used in the beginning of sentence in a title.
Examples:
To Fix:
Before:
George Martin - Ice & Fire 01 - A Night of the Living Dead, An Unabridged Account(v1.0).epub
<==ignored
George Martin - Ice & Fire 01 - Three Books Of Dread, a Westeros Novel.epub
<==ignored
George Martin - Ice & Fire 01 - See Spot Run, Run Spot Run (v2).epub
<==ignored
George Martin - Ice & Fire 01 - Game of Thrones, The (v5.0).epub
George Martin - Ice & Fire 01 - Game of Thrones, An (v3).epub
George Martin - Ice & Fire 01 - Game of Thrones, A (v1.0).epub
George Martin - Ice & Fire 01 - Game of Thrones, The.epub
George Martin - Ice & Fire 01 - Game of Thrones, An.epub
George Martin - Ice & Fire 01 - Game of Thrones, A.epub
George Martin - Game of Thrones, The (v5.0).epub
George Martin - Game of Thrones, An (v3).epub
George Martin - Game of Thrones, A (v1.0).epub
George Martin - Game of Thrones, The.epub
George Martin - Game of Thrones, An.epub
George Martin - Game of Thrones, A.epub
Fixed:
After:
George Martin - Ice & Fire 01 - A Night of the Living Dead, An Unabridged Account(v1.0).epub
<==ignored
George Martin - Ice & Fire 01 - Three Books Of Dread, a Westeros Novel.epub
<==ignored
George Martin - Ice & Fire 01 - See Spot Run, Run Spot Run (v2).epub
<==ignored
George Martin - Ice & Fire 01 - The Game of Thrones (v5.0).epub
George Martin - Ice & Fire 01 - An Game of Thrones (v3).epub
George Martin - Ice & Fire 01 - A Game of Thrones.epub
George Martin - Ice & Fire 01 - The Game of Thrones.epub
George Martin - Ice & Fire 01 - An Game of Thrones.epub
George Martin - Ice & Fire 01 - A Game of Thrones.epub
George Martin - The Game of Thrones (v5.0).epub
George Martin - An Game of Thrones (v3).epub
George Martin - A Game of Thrones (v1.0).epub
George Martin - The Game of Thrones.epub
George Martin - An Game of Thrones.epub
George Martin - A Game of Thrones.epub
This is what i have been able to come up with but its not quite enough it can't differentiate between articles and sentances.
*note the renamer i'm using doesn't ingore extensions so the regex takes into account there is also an extension.
This does a swap between two groups in the title section bracketed info gets swapped as well.
It doesn't differentiate between articles that need to be swapped and a sentence with a comma that does not.
When it swaps it swaps everything on either side of the comma.
Code:
(.*-)(.*),(.*)(\..*)
\1\3\2\4
This does a swap between two groups in the title section bracketed info gets swapped as well.
It doesn't differentiate between articles that need to be swapped and a sentence with a comma that does not.
When it swaps it swaps everything on either side of the comma.
Code:
(.*) - ([^,]*)(?:, (.*))\.(.*)
\1 - \3 \2.\4
This does a swap between two groups in the title section and leaves bracketed info in place.
It doesn't differentiate between articles that need to be swapped and a sentance with a comma that does not.
If its a sentence after the comma it grabs the first word and swaps it and leaves the rest in place.
Code:
(.* - ){1,2}([\w ]+), (\w*)(.*)\.(\w+)
\1\3 \2\4.\5
any help would be appreciated thank you.