HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <p>Click the button to do a global case-insensitive search for any of the specified alternatives (Who|styLe).</p> <button onclick="myFunction()">Click me</button> <p id="point"></p> <script> function myFunction(){ var str = "His style Is who is he IS"; var pattern = /(Who|styLe)/gi; var result = str.match(pattern); document.getElementById("point").innerHTML = result; } </script> </body> </html>
OUTPUT
×

Save as Private