View Single Post
Old 10-30-2018, 09:52 AM   #10
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 davidfor View Post
That seems to work here. There is probably a better way to do it, but, that's what comes to mind at the moment.
A template function is probably the best because it is the fastest. However, should you want to do it in the template language, this seems to work.
Code:
program: list_re_group(field('author_sort'), ' & ', '.', '(.*?)(,|$)(.*)', '{$:uppercase()}')
It first separates the list of authors, Then for each author it applies a regexp to find the value before the comma and uppercases that value. If there isn't a comma then the entire author is uppercased.
chaley is offline   Reply With Quote