正则表达式表达全部为空格
var test = " \n ";
//var test = " ";
if(test.match(/^\s+$/)){
console.log("all space or \\n")
}
if(test.match(/^[ ]+$/)){
console.log("all space")
}
if(test.match(/^[ ]*$/)){
console.log("all space or empty")
}
if(test.match(/^\s*$/)){
console.log("all space or \\n or empty")
}