\s 元字符用于查找空白字符。
空白字符可以是:
所有主要浏览器都支持 \s 元字符
对字符串中的空白字符进行全局搜索:
var str="Is this all there is?"; var patt1=/\s/g; 下面被标记的文本显示了表达式获得匹配的位置: Is this all there is?