Cope with invalid regex