JavaScript RegExp \xxx meta characters
- Previous Page \v
- Next Page \xdd
- Go to the Previous Level JavaScript RegExp Reference Manual
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.
usepatternAs 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 \v
- Next Page \xdd
- Go to the Previous Level JavaScript RegExp Reference Manual