var existing = "";
if(disk.isLinux){
var valinvalid = "/usr" ;
var valinput = /^\/[a-zA-Z]{2,}/ ;
if(!valinput.match(valinvalid)){
return "^/" + existing + "[^/][a-zA-Z]{2,}[^/]$";
}
}
Here im trying to do the following in the first if condition ie. if(disk.isLinux):
1. there should be minimum 3 characters
2. the first character should be /
3. the entire input shouldnt match "/usr". But it can be /us or /usra