Quote:
Originally Posted by Phssthpok
But you're right, it doesn't seem to work for single-name authors. No comma, no match in the RE. Hmm... 
|
Cheap-and-nasty fix: make the comma-plus-name optional:
Quote:
{author_sort:'re(list_re($, '&', '^([^,]*)(,(.*))?$', '\3 \1'),'&',', ')'}
|
The only issue is that it's now taking everything up to the first comma as the last name, whereas before it was everything up to the last comma -- but there's only ever one (by design, when I tweak the author_sort values for "special" names), so it doesn't matter.
Leading and trailing spaces seem to be trimmed, so no further effort is needed.
Oh, and you're right about the trailing-space-only thing -- I must have fumbled it before.