View Single Post
Old 01-16-2013, 05:16 AM   #8
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 1,678
Karma: 3275002
Join Date: Nov 2012
Location: New Zealand
Device: Kobo Glo
Quote:
Originally Posted by chaley View Post
Why can't you do this with a metadata plugboard? Something like
Code:
{authors:'re($, ' & ', ', ')'}
will change all the ampersands to commas. It doesn't deal with the apparent exception -- changing the last ampersand to ' and ', but this should be possible using a nested re. Something like
Code:
{authors:'re(re($, '(.*) & '. '\1 and'), ' & ', ', ')'}
Thanks chaley! I just made minor corrections (space after and, replace period with comma), and it seems to work exactly right:

Code:
{authors:'re(re($, '(.*) & ', '\1 and '), ' & ', ', ')'}
GeoffR is offline   Reply With Quote