<!DOCTYPE html>
<html lang="en-US">
<body>
<p>Click the button to do a case-insensitive global search for "is" at the end of each line of a string.</p>
<button onclick="myFunction()">Click me</button>
<p id="point"></p>
<script>
function myFunction(){
var str = "His\n style Is\n who is\n he IS";
var pattern = /is$/gmi;
var result = str.match(pattern);
document.getElementById("point").innerHTML = result;
}
</script> </body>
</html>