Very strange that it didn't work for you, because this code is working all right for me
Code:
from datetime import datetime
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
return datetime.now().strftime("%d-%m-%Y")
Maybe the problem was with the search string ?