Result Size: 625 x 534
x
 
<!DOCTYPE html>
<html>
<body>
<p>单击该按钮可在字符串的每一行开头对“is”进行全局多行搜索。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  var str = "\nIs th\nis h\nis?";
  var patt1 = /^is/gm;
  var result = str.match(patt1);
  document.getElementById("demo").innerHTML = result;
}
</script>
</body>
</html>