JavaScript 正则表达式RegExp的source属性


JavaScript 正则表达式RegExp的source属性

<html>

   <head>
      <title>JavaScript RegExp source Property</title>
   </head>

   <body>

      <script type = "text/javascript">
         var str = "Javascript is an interesting scripting language";
         var re = new RegExp( "script", "g" );

         re.test(str);
         document.write("The regular expression is : " +  re.source);
      </script>

   </body>
</html>