正则表达式表达全部为空格


正则表达式表达全部为空格
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")
}
0

【正则表达式表达全部为空格隶属于分类:

它起初由本站用户:刘欣Eden于9个月前 创建。

该内容的链接是:

目录