正则表达式判断是否是合法路径
function testPath() {var path = /^[a-zA-Z]:[\\]((?! )(?![^\\/]*\s+[\\/])[\w -]+[\\/])*(?! )(?![^.]*\s+\.)[\w -]+$/;var backuppath = document.getElementById("xxx");if (path.test(backuppath)) {return true;} else {alert("请填写正确路径!");return false;}return true;}