This functions main purpose is to replace certain character sequences in a string using Patterns.
In case of a table, the matched sequence will be used as key and the table will tested for the key, if a value exists it will be used as replacement.
In case of a function all matches will be passed as parameters to the function, the return value(s) of the function will then be used as replacement.