View Single Post
Old 09-18-2014, 05:19 PM   #566
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,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by DMee View Post
On a similar vein, rather than just the initials - is it possible to have the first x characters of each word?

Lor-of-the-Rin [01] etc ??
Yes. The part in red is captured to make initials.

Code:
Name: #initials. Template: {#stripped_series:re([\s]?([^\s])[^\s]+(\s|$),\1)}
Change it to
Code:
([^\s]{1,x})
where x is the number of characters you want (including the first time).
So using {1,3} means use that set [^\s] at least once and not more than 3x.
{0,1} is another way of saying "?", or "optional". (Either match only the initial time, or not at all.)

For further information (that is, gory details ) on repeating characters see: http://www.regular-expressions.info/repeat.html#limit
eschwartz is offline   Reply With Quote