View Single Post
Old 10-01-2021, 08:26 AM   #164
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,475
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
That makes sense. I think the easiest solution would to make it only run on tags starting with Fanfiction. (with the dot). Having a bit of trouble with the regex though.

Code:
program:

if $$#fanficcat then
			re(sublist($tags, 0, 1, ','), 'Fanfiction\.', 'Fanfiction/')

fi
didn't work (and it's a bit clumsy anyways)
What exactly are you trying to do? It looks like you want the word 'Fanfiction/' if the word 'Fanfiction.' is in tags. Right? If so then this works.
Code:
	if '^Fanfiction\.' inlist $tags then 'Fanfiction/' fi.
However, you might want 'Fanfiction.foo' to become 'Fanfiction/foo'. If so then this works:
Code:
	list_re($tags, ',', '^Fanfiction.(.*)$', 'Fanfiction/\1')
chaley is offline   Reply With Quote