improve keyword and anonymous input for replace (and %)