python regex errors fixed