![]() |
#1 |
Member
![]() Posts: 14
Karma: 10
Join Date: Oct 2014
Location: Koblenz, Germany
Device: Kindle Fire HD 6, Pocketbook Touch Lux, Tolino Vision
|
Help with regex: surely simple, but I don't know how
a) I have a great number of ebooks with series in title, but wenn I try to put them in Calibre with this regex:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ? I get some faults. First with double names like Jane Miller-Mitch, then Mitch is put in series. Calibre should search vor ( - ). b) In Calibre I want to search vor german special vocals (=Umlauten) like ö, ä or ü. Or i want to find words like neü. Sorry, but i Can't manage this. Would you please help me? Thanks |
![]() |
![]() |
![]() |
#2 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
If "-" is in the author name, then using it for the field separator becomes more difficult.
Is there a particular pattern your book filenames have? Maybe list a few of them. ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Moved
Recipes is for News (type) download recipes, not Library import templates |
![]() |
![]() |
![]() |
#4 | |
Member
![]() Posts: 14
Karma: 10
Join Date: Oct 2014
Location: Koblenz, Germany
Device: Kindle Fire HD 6, Pocketbook Touch Lux, Tolino Vision
|
Sorry, theducks, I'll remember this.
Quote:
given name like Marie-Christine, family name Meier-Muller, series Conan-Saga or in title. I really need a way to declare exactly: space - space Sorry, my english learning is thirty years ago. |
|
![]() |
![]() |
![]() |
#5 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 309
Karma: 1645952
Join Date: Jun 2012
Device: none
|
This is just a guess, but I notice you have a couple of instances of \s* in your regex.
What happens if you change them to \s+ instead? The way you have it now, it will match to 0 or more whitespace characters, but I think you want it to match to 1 or more. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() hyphenated family names have no space surrounding, so 1 or more will not split there |
|
![]() |
![]() |
![]() |
#7 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Current:
Code:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ? Code:
(?P<author>[^_]+) - (?P<series>[^_0-9-]+) (?P<series_index>[0-9]+) - (?P<title>[^_].+) author - series series_number - title Where author can have a "-" as long as it is the only one without spaces surrounding it. Series should be optional: Code:
(?P<author>[^_]+)( - (?P<series>[^_0-9-]+) (?P<series_index>[0-9]+))? - (?P<title>[^_].+) |
![]() |
![]() |
![]() |
#8 |
Member
![]() Posts: 14
Karma: 10
Join Date: Oct 2014
Location: Koblenz, Germany
Device: Kindle Fire HD 6, Pocketbook Touch Lux, Tolino Vision
|
[solved]
Thanks you all. Now it's easy to integrate series. I use the code of eschwartz and it works.
|
![]() |
![]() |
![]() |
#9 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Happy to help.
![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
A little help with a regex please, if you don't mind? | timberbeast | Editor | 10 | 05-08-2014 09:03 PM |
Simple Regex request | Giuseppe Chillem | Calibre | 0 | 11-13-2011 10:04 PM |
Surely this is a scam? | Asawi | Deals and Resources (No Self-Promotion or Affiliate Links) | 17 | 04-21-2011 04:13 AM |
Unutterably Silly Surely not OUR VR???? | ShortNCuddlyAm | Lounge | 30 | 10-18-2009 04:46 AM |