My regular expression keeps failing and not sure what i’m doing wrong, code below:
var get_memberCity = "test";
let cityRGEX = /^([a-zA-Z]{0, 5})$/;
let cityResult = cityRGEX.test(get_memberCity);
/****************************************************************************/
if(get_memberCity != "" ) {
console.log("RegExp test =>: "+ cityResult + " --- cityREGX -->: "+cityRGEX);
if(cityResult) {
console.log("Valid");
} else {
console.log("Failed");
return false;
}
}