I have functions
def getName():
name = "Mark"
return name
def getDay():
day = "Tuesday"
return day
I have a variable
message = "Hi there [getName] today is [getDay]"
I need to check all occurences for the strings between the square brackets in my message variable and check whether that name is a function that exists so that I can evaluate the value returned by the function and finally come up with a new message string as follows
message = "Hi there Mark, today is Tuesday
messagevariable will be called from a database record. And if this way poses a security risk. How else would you go about to solve such a problem?