Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 10-27-2015, 01:59 PM   #1
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
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
domax is offline   Reply With Quote
Old 10-27-2015, 08:44 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Advert
Old 10-27-2015, 09:18 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
theducks is offline   Reply With Quote
Old 10-29-2015, 05:47 AM   #4
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
Sorry, theducks, I'll remember this.

Quote:
Is there a particular pattern your book filenames have?
No, it isn't. Most are in the way "Give name Family name - series series no. - title". The problem can be:
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.
domax is offline   Reply With Quote
Old 10-29-2015, 10:48 AM   #5
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
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.
fidvo is offline   Reply With Quote
Advert
Old 10-29-2015, 11:57 AM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by fidvo View Post
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.

hyphenated family names have no space surrounding, so 1 or more will not split there
theducks is offline   Reply With Quote
Old 10-29-2015, 12:19 PM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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>[^_].+) ?
New:
Code:
(?P<author>[^_]+) - (?P<series>[^_0-9-]+) (?P<series_index>[0-9]+) - (?P<title>[^_].+)
This *should* accept anything in the form:
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>[^_].+)
eschwartz is offline   Reply With Quote
Old 10-30-2015, 08:36 AM   #8
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
[solved]

Thanks you all. Now it's easy to integrate series. I use the code of eschwartz and it works.
domax is offline   Reply With Quote
Old 10-30-2015, 12:35 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 02:49 AM.


MobileRead.com is a privately owned, operated and funded community.