[fix] broken logic fix and make regex var clearer