RegExp constructor Property - Javascript RegExp

Javascript examples for RegExp:Property

Description

For JavaScript regular expressions the constructor property returns function RegExp() { [native code] }

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

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

<script>
function myFunction() {//  ww  w .  ja v a  2  s. co  m
    var patt = new RegExp("Hello World", "g");
    var res = patt.constructor;
    document.getElementById("demo").innerHTML = res;
}
</script>

</body>
</html>

Related Tutorials