task engine, fixed re.sub usage for python 2.6, fixes #209