old python api doesn"t support re.sub(flag=*)