Hi. I have to check a string client side. If it contain only "\" (1, 2, or 1000 time) i need to refuse it. Code (with some of your suggestion that unfortunatly dont work):
value.replace(/\\/g, '');
if(value=="") alert("NO"); else alert("YES");
so :
value="\" = NO
value="\hello \people" = YES
value="\\\\hello \\people" = YES
value="hello \\people" = YES
value="hello people\" = YES
value="\\" = NO
value="\\\\\\" = NO
value="\\ \\\\ \ \\\" = NO