Matthew Barnett added the comment: The 4th argument of re.sub is the count, not the flags. Not a bug. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue26354> _______________________________________