View Single Post
Old 09-07-2014, 04:23 AM   #2
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)
general program mode is far more flexible and allows multiple functions to be used in arbitrary ways. Unlike single-function mode, it does not assume you are operating on the base template (because there is none) and the field you wish to use must be explicitly stated as the first parameter.

Try:
Code:
program:

shorten(
    re(
        field('comments'),
        'some-regex',
        'replacement-text is empty'
    ),
    50,
    '...',
    0
)
Whitespace is optional. I use it to lay out the template and what I am doing more clearly.

Last edited by eschwartz; 09-07-2014 at 04:31 AM.
eschwartz is offline   Reply With Quote