Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-09-2015, 01:39 AM   #1
StillReading
Enthusiast
StillReading began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Sep 2014
Device: none
Search for first author_sort entry starting with letter x

I've been using searches like this for a while:
Code:
author_sort:"~(^[AaBbCcDd])|(&\s*[AaBbCcDd])"
This works perfectly fine, but on multi-author books it matches all authors that begin with the respective letters. Is there a way to search only for the the first "author_sort" entry? The only idea I can come up with is to create a custom field and use the "list_item" template function to fill it, but I'd prefer to use a search instead if possible.
StillReading is offline   Reply With Quote
Old 10-09-2015, 03:49 AM   #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)
????


Why not just prune the extra:
Code:
|(&\s*[AaBbCcDd]
at the end?

Also, the search is case-insensitive.
You could just use the set [A-D]
eschwartz is offline   Reply With Quote
Advert
Old 10-13-2015, 02:33 AM   #3
StillReading
Enthusiast
StillReading began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Sep 2014
Device: none
Thanks for the info, eschwartz! Makes me feel pretty stupid - I should have seen that I was using a combination of two expressions in my searches. I copied the search string from some website and never bothered with trying to understand how the expression works - RegEx is still pretty alien to me (; .
StillReading is offline   Reply With Quote
Old 10-13-2015, 02:45 AM   #4
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)
Well, if you haven't had the opportunity to get a grounding in regex before, then you don't have to feel bad about not knowing it.


But since regex is pretty cool, and there's a lot of cool stuff you can do with it, I encourage you to take a look at the following tutorial -- it's the one that taught me everything I know: http://www.regular-expressions.info/


One of the most valuable things it does is provide detailed step-by-step explanations about what the regex engine sees while it works.

Last edited by eschwartz; 10-13-2015 at 02:48 AM.
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Column for Author_Sort? hurricane51 Library Management 5 01-25-2024 06:24 PM
author_sort Jorge Junior Library Management 3 11-12-2012 10:20 AM
Problems with author_sort Poldi Calibre 1 10-26-2012 07:31 AM
restore previous search box entry on restart cybmole Calibre 2 11-22-2011 04:07 AM
What am I missing? (author_sort) megachirops Calibre 12 09-06-2010 11:15 AM


All times are GMT -4. The time now is 01:37 PM.


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