RegExp \xxx Metacharacter - Javascript RegExp

Javascript examples for RegExp:Metacharacter

Description

The \xxx character matches the Latin character specified by an octal number xxx.

If no match is found, it returns null.

The following code shows how to Do a global search for octal number 127 (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() {/*from   w w w .  j a v a2  s .co m*/
    var str = "The following code shows how to . Hello World!";
    var patt1 = /\127/g;
    var result = str.match(patt1);
    document.getElementById("demo").innerHTML = result;
}
</script>

</body>
</html>

Related Tutorials