View Single Post
Old 07-04-2014, 12:24 AM   #516
eschwartz
Irrational Optimist
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: 7,350
Karma: 12814281
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-04-2014 at 12:29 AM.
eschwartz is offline   Reply With Quote