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 04-02-2022, 09:01 PM   #1
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 9,817
Karma: 68360983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Template Search: Exact matching

My readstatus() function can return currentlyreading|toberead|read|unread|undefined.

When I use template:"program:readstatus()#@#:t:read" it captures anything with 'read' in the string, which obviously is a problem here.

Is there a way to have the template search use an exact match so I can avoid the if-value-then-yes template?

^read$ doesn't return antthing.

Last edited by ownedbycats; 04-02-2022 at 09:13 PM.
ownedbycats is offline   Reply With Quote
Old 04-03-2022, 10:21 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,143
Karma: 7908995
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The compare value is any of the search operators.

In your case I think you want to use an regular expression match mode
Code:
template:"program:readstatus()#@#:t:~^read"
or an exact match mode
Code:
template:"program:readstatus()#@#:t:=read"
EDIT: As the documentation says: "The value is whatever you want. It can use the special operators described above for the various search types."

Last edited by chaley; 04-03-2022 at 10:41 AM.
chaley is offline   Reply With Quote
Advert
Old 04-03-2022, 04:04 PM   #3
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 9,817
Karma: 68360983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
That works. I see what happened; when I tried using the advanced search to do it I got this, which didn't work:

Code:
template:"program: readstatus()#@#:t:^read$"
Thank you.
ownedbycats is offline   Reply With Quote
Old 04-03-2022, 06:01 PM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,143
Karma: 7908995
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
That works. I see what happened; when I tried using the advanced search to do it I got this ...
I will improve the tooltip for the "Template value" box to make it clearer that you must use the search operators for exact and regex searches.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Template: Matching an entire list ownedbycats Library Management 20 05-10-2021 12:08 AM
Template: Strcat matching ownedbycats Library Management 7 03-20-2021 11:15 PM
Book Details exact Tag Matching? uli Calibre 5 10-29-2019 01:07 PM
Exact author search, last name only? fncll Library Management 5 11-15-2018 07:38 PM


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


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