stringa = "000000"
RE = new RegExp("^0+$")
if (RE.test(stringa)) alert("Sono tutti 0!")

ciao