JavaScript 正则表达式RegExp的test方法 JavaScript 正则表达式RegExp的exec方法 JavaScript 正则表达式RegExp的toString方法 JavaScript 正则表达式RegExp的test方法 <html> <head> <title>JavaScript RegExp test Method</title> </head> <body> <script type = "text/javascript"> var str = "Javascript is an interesting scripting language"; var re = new RegExp( "script", "g" ); var result = re.test(str); document.write("Test 1 - returned value : " + result); re = new RegExp( "pushing", "g" ); var result = re.test(str); document.write("<br />Test 2 - returned value : " + result); </script> </body> </html> JavaScript 正则表达式RegExp的exec方法 JavaScript 正则表达式RegExp的toString方法