<!DOCTYPE html>
<html lang="en-US">
<body>
<p>Click the button to do a global case-insensitive search for "b.x" in a string.</p>
<button onclick="myFunction()">Click me</button>
<p id="point"></p>
<script>
function myFunction(){
var str = "Bex, Box, Bix are friends";
var pattern = /b.x/gi;
var result = str.match(pattern);
document.getElementById("point").innerHTML = result;
}
</script> </body>
</html>