View Single Post
Old 11-04-2015, 06:51 AM   #3
domax
Member
domax began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Oct 2014
Location: Koblenz, Germany
Device: Kindle Fire HD 6, Pocketbook Touch Lux, Tolino Vision
Wrong Regex

Hello,
it's a very good idea to help new users with regex. I need them especially for adding books and find it useful (and difficult) for searches in book list.
Therefor we should have a place where new users find many examples.
But here is one example that's wrong, if there's a double name like:
Morland-Miller, A. F. - Tony Ballard 001 - Help me.txt
Your regex
Quote:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ?
don't match exactly, but

Quote:
(?P<author>[^_]+) - (?P<series>[^_0-9-]+) (?P<series_index>[0-9]+) - (?P<title>[^_].+)
is correct.
domax is offline   Reply With Quote