Different python versions have different regex flags