Make invalid regex test version agnostic