Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <body> <p id="demo">Click the button to do a global search for "is" in a string.</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var str = "Is this all there is?"; var patt1 = /is/g; var result = str.match(patt1); document.getElementById("demo").innerHTML=result; } </script> </body> </html>
Result:
W3Schools.com - Try it yourself