Quote:
Originally Posted by Req13
I have been trying to figure out how to use the saving books to disk template.
When I save a book that is named something like:
Mark Twain - Anthologies: How Many Are There?
I would like to replace the colon with a semicolon and remove the question mark so that it comes out as this:
Mark Twain - Anthologies; How Many Are There
Is there a way to achieve that? This is all I've been able to work out so far.
Code:
Replace ? with nothing
{authors} - {title:re(\?,)}
--------------------------------------------------------
Replace ? and : with nothing
{authors} - {title:re(\?|\:,)}
--------------------------------------------------------
Replace : with ;
{authors} - {title:re(:,;)}
I'd also like to possibly add to it if I need to change other special characters to something other than an underscore.
Thanks for any help.
|
One way that is easy to extend in the future.
Code:
program:
t = $title;
t = re(t, '\?', '');
t = re(t, ':', ';');
# Add any more changes that you want.
FWIW: I prefer
GPM templates over the other template modes.