JavaScript RegExp \0 元字符
- Previous Page \B
- Next Page \n
- Go Back to the Previous Level JavaScript RegExp Reference Manual
定义和用法
\0
元字符匹配 NUL 字符。
语法
new RegExp("\\0")
或者简写:
/\0/
浏览器支持
/\0/
是 ECMAScript1 (ES1) 特性。
所有浏览器都完全支持 ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
支持 | 支持 | 支持 | 支持 | 支持 | 支持 |
正则表达式搜索方法
在 JavaScript 中,正则表达式文本搜索可以用不同的方法完成。
使用模式(pattern)作为正则表达式,这些是最常用的方法:
举例 | 描述 |
---|---|
text.match(pattan) | 字符串方法 match() |
text.search(pattan) | 字符串方法 search() |
pattan.exec(text) | RexExp 方法 exec() |
pattan.tuest(text) | RexExp Method test() |
- Previous Page \B
- Next Page \n
- Go Back to the Previous Level JavaScript RegExp Reference Manual