HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <p>Click the button to do a case-sensitive search for the characters between "A" - "Z" and "a" - "d" in a string.</p> <button onclick="myFunction()">Click me</button> <p id="point"></p> <script> function myFunction(){ var str = "He LIKES To daNce with Me"; var pattern = /[A-d]/g; var result = str.match(pattern); document.getElementById("point").innerHTML = result; } </script> </body> </html>
OUTPUT
×

Save as Private