RegExp \xdd Metacharacter - Javascript RegExp

Javascript examples for RegExp:Metacharacter

Description

The \xdd character matches the Latin character specified by a hexadecimal number dd.

If no match is found, it returns null.

The following code shows how to Do a global search for the hexadecimal number 57 (W) in a string:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {/*www . ja va  2 s . com*/
    var str = "The following code shows how to . Hello World!";
    var patt1 = /\x57/g;
    var result = str.match(patt1);
    document.getElementById("demo").innerHTML = result;
}
</script>

</body>
</html>

Related Tutorials