View Single Post
Old 02-03-2022, 06:10 PM   #917
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,482
Karma: 8025704
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by qqukdbx View Post
Hi, is there any regex guru who can help me to understand plugboard template "Show author name as Initial and Surname (Kindle) (inspired by brewjono)"? Im afraid i dont fully understand the syntax:
Code:
{author_sort:re(\, (.).*?( &|$),\, \1\2)}
When input from author_sort is for example "Goyal, Kovid" regex above produces "K Goyal".
How the regex matches the string and how replaces the field?
As shown by the attached screenshot, it doesn't produce "K Goyal" but instead produces "Goyal, K", which is what I would expect from the regex.

Where are you seeing the result you say you get? If it is on a device then the device is changing it. Nothing the plugboard can do about that. Workarounds might be available but you should ask in the devices forum, naming your device.
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	820
Size:	44.9 KB
ID:	192103  
chaley is offline   Reply With Quote