View Single Post
Old 05-28-2018, 07:19 AM   #2
Nicolas F
Groupie
Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.
 
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
Quote:
Originally Posted by waalw View Post
I am trying to make an regexp to get the following items from a filename

series seriesindex - title - author. I made this regexp, but the seriesname and index do not apear. What is missing?

(?P<series>[^_0-9-]*)(?P<series_index>[^_0-9-]*)\s* - (?P<title>[^_]*)\s* - \s*(?P<author>[^_].+) ?

Sample filename = De Donkere Tijd 1 - Schaduwen boven Ullart - Markus Heitz.epub
This one seems to work, using \s*-\s* as they do in the example one (\s* stands for 0 or more of any type of space)
(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+)\s*-\s*(?P<author>[^_-]+)
Nicolas F is offline   Reply With Quote