View Single Post
Old 04-12-2021, 04:46 PM   #32
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,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Do you mean the slashes in this statement?
Code:
list_re($tags, ',', '\.', '\')
For me, those are backslashes. The character '/' is a forward slash.

Unfortunately the regexp-based template language lexical analyser cannot handle escaped backslashes. To do what you want you must use some other character.

Quote:
Also, how would you apply a sublist of just first item to the list_re? See the third item in the screenshot. I tried enclosing it but I broke it. This is for my #kobopath composite for a save template.
Do I understand you correctly, that you want to apply a regexp to the first item in a list? If so then do something like (not tested)
Code:
re(sublist($tags, 0, 1, ','), '^(.*?)($|\..*$)', '\1')

Last edited by chaley; 04-12-2021 at 05:03 PM. Reason: Correct the argument order for sublist
chaley is offline   Reply With Quote