The flags option to re.sub only appeared in Python 2.7