JavaScript RegExp \xxxMetacharacter

RegExp 对象参考手册JavaScript RegExp Object

Definition and Usage

The \xxx metacharacter is used to find the character specified by an octalxxxnumber.

If no match is found, null is returned.

Syntax

new RegExp("\xxx")

Or in a simpler way:

/\xxx/


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the \xxx metacharacter


Example

Example

Perform a global search for octal 127 (W) in a string:

var str="Visit Example. Hello World!";
var patt1=/\127/g;

The textmarked belowshows the position where the expression obtained a match:

Visit Example. Hello World!

Try it Yourself »


RegExp 对象参考手册JavaScript RegExp Object Other Extensions