View Single Post
Old 07-16-2022, 11:52 AM   #2
ackomb
Zealot
ackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura aboutackomb has a spectacular aura about
 
Posts: 106
Karma: 4486
Join Date: Mar 2020
Location: Netherlands
Device: i-pad
So I've been fiddling with it some more, and figured out I can use the same principle as this

Code:
program:
	a = list_intersection($ao3tags, 'tram, train, bus, ferry', ',');
	list_union($#genre, a, ',')
but instead use 're' in the place of list-union

Code:
program:
        a = list_intersection($#show, 'Ferry, Bus', ',');
        re($#show, a , 'Vehicles, Public Transport')
The issue lies within the following, if a story has the following
tags: Bus, Car, Ferry, Ferry Terminal,
the result will be:
tags: Vehicles, Public Transport, Vehicles, Public Transport Terminal, Red, Car


The tag 'Ferry Terminal' will result in 'Public Transport Terminal'.
I figured the reason is because it is a match but not an exact match.
I've tried several options trying to get an exact match using ^ and $ like with regex but I keep getting errors

Can anyone point me in the right direction, because the Calibre Manual is not getting me anywhere on this one.
ackomb is offline   Reply With Quote