Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 03-15-2017, 03:13 PM   #1
lairdb
dog ear
lairdb began at the beginning.
 
Posts: 53
Karma: 12
Join Date: Jan 2012
Device: lots
Regex in search problems (NOT Search&Replace; the search bar)

I'm having real trouble getting regex search in the search bar to work, especially within the identifiers field. (I don't know if it's a Python thing, but multi-valued fields seem to be getting treated... oddly.)

Here's what I'm trying to accomplish, in case there's an easier way. What I want the search to yield are rows that have an odid identifier that is not an ak/prime or ak/unlimited identifier. Here are three (made up) identifiers records:

Code:
isbn:9781611099690, odid:B00AESRRQS@ak/prime&B00AESRRQS@ak/unlimited

isbn:9781439147993, amazon:143914799X, goodreads:6933152, google:ibWojDN848kC, odid:346656@sdcl.overdrive.com&346656@sfpl.overdrive.com

isbn:9781439147993,  odid:346656@sdcl.overdrive.com&346656@sfpl.overdrive.com&B00AESRRQS@ak/unlimited
In this example, I would get rows 2 and 3, because they have odid identifiers that are not ak/prime or ak/unlimited; I would not get record 1 because although it has odid identifiers, none of them are non-ak.

The regex odid:.*@(?!(ak\/u|ak\/p)) does what I expect in a tester, but I can't get it to work in Calibre.

ETA: I've tried
odid:.*@(?!(ak\/u|ak\/p))
~odid:.*@(?!(ak\/u|ak\/p))
"~odid:.*@(?!(ak\/u|ak\/p))"
identifiers:"~odid:.*@(?!(ak\/u|ak\/p))"
and none of them yield results.

Thanks.

Last edited by lairdb; 03-15-2017 at 03:25 PM.
lairdb is offline   Reply With Quote
Old 03-15-2017, 03:45 PM   #2
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: 30,454
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
the field name is identifiers:
You are working with a (sub) field value
theducks is offline   Reply With Quote
Advert
Old 03-15-2017, 05:05 PM   #3
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,759
Karma: 86500093
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
This should work:

Code:
identifiers:"=odid:~@(?!ak/(unlimited|prime))"
jhowell is offline   Reply With Quote
Old 03-15-2017, 08:10 PM   #4
lairdb
dog ear
lairdb began at the beginning.
 
Posts: 53
Karma: 12
Join Date: Jan 2012
Device: lots
Quote:
Originally Posted by theducks View Post
the field name is identifiers:
You are working with a (sub) field value
Of course, a subfield. What is a subfield?

("Your search - subfield site:calibre-ebook.com - did not match any documents.")

Quote:
Originally Posted by jhowell View Post
This should work:
Code:
identifiers:"=odid:~@(?!ak/(unlimited|prime))"
Yes, thanks, and simpler than mine. Is there an actual syntax somewhere for the search box, where syntax like that might be discussed or exampled?

https://manual.calibre-ebook.com/gui...arch-interface does not have anything about subfields, and the passing mention of the equals sign is incomplete and possibly inconsistent.

https://manual.calibre-ebook.com/regexp.html has a huge explanation of how regexes work -- and nothing at all about how to use them in the search bar, which is substantially different from the S&R usage.

Thanks.
lairdb is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex Search doesn't search all files in Edit Book GregTheGrate Editor 8 11-08-2016 01:47 AM
regex search/replace - how to? Alt68er Sigil 1 03-11-2014 09:53 PM
Regex help: Edit Meta Search & Replace: Pad with zero _noel_ Calibre 4 11-26-2012 05:31 PM
Search & Replace problems with pdf conversion Longmatys Conversion 1 01-25-2012 05:59 AM
Search & Replace/Regex help!! millertime13 Conversion 4 07-22-2011 03:40 AM


All times are GMT -4. The time now is 09:23 PM.


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