Javascript examples for RegExp:Property
For JavaScript regular expressions the constructor property returns function RegExp() { [native code] }
<!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>