Mega Code Archive

 
Categories / JavaScript Tutorial / Regular Expressions
 

RegExp global

The global property specifies whether or not the g flag is used with the regular expression. If so, a global pattern match will be performed. <html>     <body>     <script language="JavaScript">     <!--         var myPat = new RegExp("is", "g");              var str = "This is a test";              myArray = myPat.exec(str);              document.write("The value of RegExp.global is: " + "<b>" + myPat.global + "</b>");     -->     </script>     </body>     </html>