JavaScript RegExp \xxx meta characters
- Προηγούμενη σελίδα \v
- Επόμενη σελίδα \xdd
- Επιστροφή στο προηγούμενο επίπεδο Εγχειρίδιο Επεξεργασίας JavaScript RegExp
definition and usage
\xxx Meta characters defined by octal numbers (xxx) matches Latin characters.
instance
Search for octal number 127 (W) globally in the string:
let text = "Visit CodeW3C.com. Hello World!"; let pattern = /\127/g;
syntax
new RegExp("\\xxx)
or abbreviated as:
/\xxx/
Syntax with modifiers
new RegExp("\\xxx", "g")
or abbreviated as:
/\xxx/g
browser support
/\xxx/
is ECMAScript1 (ES1) feature.
All browsers fully support ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
support | support | support | support | support | support |
Regular expression search methods
In JavaScript, regular expression text search can be completed with different methods.
usagepatternAs 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() |
- Προηγούμενη σελίδα \v
- Επόμενη σελίδα \xdd
- Επιστροφή στο προηγούμενο επίπεδο Εγχειρίδιο Επεξεργασίας JavaScript RegExp