In article <mailman.1019254077.7316.python-list at python.org>, holger krekel wrote: > re.sub('\{\{(.*?)\}\}',lambda x: dict[x.group(1)], str) Need a raw string there, i.e. r"\{\{(.*?)\}\}" Plus 'str' is perhaps not the best choice of variable name ;-)