描述
\t 匹配 Tab 字符 (\u0009)。
例子
以下示例显示了 RegExp 表达式的用法。
<script type = "text/javascript">
var str = "ab\tc";
var pattern = /\t/g;
var index = str.search(pattern);
document.write("测试1 - 返回值 : " + index);
str = "abc";
index = str.search(pattern);
document.write("<br/>测试2 - 返回值 : " + index);
</script>
输出
测试1 - 返回值 : 2
测试2 - 返回值 : -1
测试2 - 返回值 : -1