JavaScript RegExp \0 metacharacter
- Επόμενη σελίδα \B
- Προηγούμενη σελίδα \n
- Επιστροφή στο προηγούμενο επίπεδο Εγχειρίδιο Αναφορών JavaScript RegExp
definition and usage
\0
match NUL character with metacharacters.
instance
search 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.
usepattern (pattern)As regular expressions, these are the most commonly used methods:
example | description |
---|---|
text.match(pattern) | 字符串方法 match() |
text.search(pattern) | 字符串方法 search() |
pattern.exec(text) | RexExp 方法 exec() |
pattern.test(text) | Μέθοδος test() του RexExp |
- Επόμενη σελίδα \B
- Προηγούμενη σελίδα \n
- Επιστροφή στο προηγούμενο επίπεδο Εγχειρίδιο Αναφορών JavaScript RegExp