![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Feb 2018
Device: kobo aura
|
what ia I doing wrong?
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 |
![]() |
![]() |
![]() |
#2 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
|
Quote:
![]() (?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+)\s*-\s*(?P<author>[^_-]+) |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,939
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
you have \s*<a space>-
the \s* gobbles all spaces before the literal space, therefore if fails Nickolas has it right 0 or more spaces |
![]() |
![]() |
![]() |
Tags |
regexp |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
I must be doing something wrong | hope729 | Editor | 0 | 01-15-2016 12:53 PM |
Am I doing something wrong? | rtgjeg | Amazon Kindle | 6 | 12-13-2015 11:46 PM |
The Robbery: A Short Story that goes wrong for all the wrong reasons | brinlingfm | Self-Promotions by Authors and Publishers | 0 | 03-22-2011 08:20 AM |
Dates wrong on scheduled news: what am I doing wrong? | Rod Laird | Calibre | 5 | 11-05-2010 06:06 PM |
What did I do wrong? | ginag | Sigil | 3 | 06-24-2010 05:16 AM |