View Single Post
Old 10-16-2024, 11:13 PM   #4
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: 11,104
Karma: 77213681
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
For your example, you don't need to match every specific tag - without the anchors (see the 'cozy mystery' line in the above post), 'fantasy' will match both fantasy & high fantasy, for example.

Code:
program:	

subjects = $tags;
## Replace this with your collection column
existing_colls = $#kobocoll;

	new_colls = strcat(	
		if '(Comedy|Humor)' inlist subjects then 'Comedy,' fi,
		if '(Fantasy|Mythology)' inlist subjects then 'Fantasy,' fi,
		if '(Romance|Love)' inlist subjects then 'Romance,' fi,
	);

	merged_colls = list_union(new_colls, existing_colls, ',');
ownedbycats is offline   Reply With Quote