View Single Post
Old 10-19-2021, 03:59 PM   #16
DyckBook
Morlock
DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.
 
DyckBook's Avatar
 
Posts: 34
Karma: 2734796
Join Date: Oct 2021
Device: Kindle Paperwhite
Quote:
Originally Posted by lomkiri View Post
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):

    i = match.group(2)
    if i: 
        return match.group(1) + str(int(i) +1) + match.group(3)
    return  match.group(0)
@lomkiri Thanks for posting this solution to @Karellen's problem.

I needed to sync some endnotes with their refs. In the manual I found a template language function called BuiltinAdd, but am not skilled enough to make use of it. Then I came across your solution and it worked for me.
DyckBook is offline   Reply With Quote