fix invalid regex crash