| 
			
			 | 
		#1 | 
| 
			
			
			
			 dog ear 
			
			![]() 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 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.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				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  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,162 
				Karma: 92500001 
				Join Date: Nov 2011 
				Location: Charlottesville, VA 
				
				
				Device: Kindles 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			This should work: 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Code: 
	identifiers:"=odid:~@(?!ak/(unlimited|prime))"  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | ||
| 
			
			
			
			 dog ear 
			
			![]() Posts: 53 
				Karma: 12 
				Join Date: Jan 2012 
				
				
				
				Device: lots 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 ("Your search - subfield site:calibre-ebook.com - did not match any documents.") Quote: 
	
 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.  | 
||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
            
  | 
    
			 
			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 |