added optional flags argument to engine.string.replace_multiple()