Edit Code in left box and click Show Results button to see the result. | Home
<html> <!-- Mirrored from www.tutorialspoint.com/cgi-bin/practice.cgi?file=javascript_158 by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 01 Sep 2011 14:44:02 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8"><!-- /Added by HTTrack --> <head> <title>JavaScript RegExp global Property</title> </head> <body> <script type="text/javascript"> var re = new RegExp( "string" ); if ( re.global ){ document.write("Test1 - Global property is set"); }else{ document.write("Test1 - Global property is not set"); } re = new RegExp( "string", "g" ); if ( re.global ){ document.write("<br />Test2 - Global property is set"); }else{ document.write("<br />Test2 - Global property is not set"); } </script> </body> <!-- Mirrored from www.tutorialspoint.com/cgi-bin/practice.cgi?file=javascript_158 by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 01 Sep 2011 14:44:02 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8"><!-- /Added by HTTrack --> </html> |