View Single Post
Old 07-03-2014, 11:24 PM   #516
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
You will need to escape the comma as "\," (but in the python script, since the pattern was quoted, escaping wasn't necessary).

It still errors, I'm not sure why, but it is more complex than it needs to be, so...

Try this template, which I rewrote from scratch:

Code:
{author_sort:re(\, (\w)\w*,\, \1.)}
Explanation:

Search for:
comma, space, letter (captured), letters. [Stop at the first non-letter value.]

Replace with:
comma, space, captured first letter, period

Last edited by eschwartz; 07-03-2014 at 11:29 PM.
eschwartz is offline   Reply With Quote