|
|
#1 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,382
Karma: 79699999
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. |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,528
Karma: 8065948
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" Code:
template:"program:readstatus()#@#:t:=read" Last edited by chaley; 04-03-2022 at 10:41 AM. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,382
Karma: 79699999
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$" |
|
|
|
|
|
#4 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,528
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
|
|
|
![]() |
|
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 |