| 
			
			 | 
		#1 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 9 
				Karma: 10 
				Join Date: May 2021 
				
				
				
				Device: Kobo Clara HD 
				
				
				 | 
	
	
	
		
		
			
			 
				
				Regex search for year read
			 
			
			
			Hi, I gather that I need to do something with regex for this but it makes my head spin and none of my guesses have worked. In my custom #review column, I input the days that I read something in the following format: 
		
	
		
		
		
		
		
		
		
		
		
		
	
	[First read, DD MM YYYY to DD MM YYYY] With "first" changing accordingly. I then follow this up with my thoughts after that particular reading. I would like to create a set of saved searches for the years that I've got this data, so that I can find all books that I finished in the year 2019, say. I can do this somewhat with the search #review:2019, but this includes books that were started in 2019 but not finished that year. And of course if I mention a year or even just a number that looks like a year in the text of a review, that will show up as well. I'm just wondering how to phrase the search expression so that it only catches the year in the format that I use.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			You used a text field so standard date ranges will not work 
		
	
		
		
		
		
		
		
		
		
		
		
	
	example for 2015-2016 Code: 
	#review:first read\,>=\d\d \d\d 2015 and #review:first read\,<= \d\d \d\d 2016 So you need the field name: #review: you need the words with comma: first read\, you need wild cards for all non critical digits \d\d\s\d\d\s then the actual 4 digit year Another way for the year part if consecutive Code: 
	#review:first read\,>=\d\d \d\d 201[5-6]  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
![]()  | 
            
        
    
| Thread Tools | Search this Thread | 
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Regex Search in Advanced Search Box | franknight | Library Management | 2 | 07-09-2020 12:42 AM | 
| Search is a regex?? | drawson1 | Library Management | 4 | 12-21-2017 10:57 PM | 
| Regex in search problems (NOT Search&Replace; the search bar) | lairdb | Calibre | 3 | 03-15-2017 08:10 PM | 
| Regex Search doesn't search all files in Edit Book | GregTheGrate | Editor | 8 | 11-08-2016 01:47 AM | 
| Help with RegEx - add Year as Tag item | puterdude | Library Management | 0 | 01-20-2012 04:06 PM |