JavaScript RegExp \0 meta character
- Previous Page \B
- Next Page \n
- Go to the Previous Level JavaScript RegExp Reference Manual
Definition and usage
\0
Match NUL character with meta character.
Instance
Search for NUL character:
let text = "Visit codew3c.\0Learn Javascript."; let pattern = /\0/;
Syntax
new RegExp("\\0")
Or abbreviated as:
/\0/
Browser support
/\0/
Is ECMAScript1 (ES1) feature.
All browsers fully support ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Supported | Supported | Supported | Supported | Supported | Supported |
Regular expression search methods
In JavaScript, regular expression text search can be completed using different methods.
UsagePattern (pattern)As regular expressions, these are the most commonly used methods:
Example | Description |
---|---|
text.match(pattern) | String method match() |
text.search(pattern) | String method search() |
pattern.exec(text) | RexExp method exec() |
pattern.test(text) | RexExp Method test() |
- Previous Page \B
- Next Page \n
- Go to the Previous Level JavaScript RegExp Reference Manual