JavaScript RegExp \uxxxxMetacharacter
JavaScript RegExp Object
Definition and Usage
The \uxxxx metacharacter is used to find, by a hexadecimal number,xxxxthe specified Unicode character.
If no match is found, null is returned.
Syntax
new RegExp("\uxxxx")
Or a simpler way:
/\uxxxx/
Or a simpler way:
/\uxxxx/
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the \uxxxx metacharacter.
Example
Example
Perform a global search for the hexadecimal 0057 (W) in a string:
var str="Visit W3Schools. Hello World!";
var patt1=/\u0057/g;
var patt1=/\u0057/g;
Below,the markedtext shows where the expression obtained a match:
Visit W3Schools. Hello World!
Try it yourself »
JavaScript RegExp Object Other Extensions