View Single Post
Old 07-07-2016, 02:34 AM   #1
msciwoj
Junior Member
msciwoj began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2016
Device: Kindle Voyage
how to use re() function in Template Program Mode?

As per subject, knowing that in TPM all strings used as arguments must be enclosed in quotes, I'm trying:

Code:
{publisher:'re(' (Media|Publishing|Press)$','')'}
but I'm getting:

calibre, version 2.61.0
ERROR: Invalid template: <p>The template {publisher:'re(' (Media|Publishing - ebooks Account)$','')'} - {title:re(: ,:)} ({:'format_date(raw_field('pubdate'),'yyyy MMM')}) {identifiers:'ifempty(select($, 'isbn'), select($, 'asin'))'} is invalid:<br>Formatter: incorrect number of arguments for function re near )


same with double quotes:
Code:
{publisher:'re(" (Media|Publishing - ebooks Account)$","")'}
calibre, version 2.61.0
ERROR: Invalid template: <p>The template {publisher:'re(" (Media|Publishing - ebooks Account)$","")'} - {title:re(: ,:)} ({:'format_date(raw_field('pubdate'),'yyyy MMM')}) {identifiers:'ifempty(select($, 'isbn'), select($, 'asin'))'} is invalid:<br>Formatter: incorrect number of arguments for function re near )


What I'am doing wrong?
msciwoj is offline   Reply With Quote