HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <p>Click the button to do a global search for words containing at least one digit (0-9) in a string.</p> <button onclick="myFunction()">Click me</button> <p id="point"></p> <script> function myFunction(){ var str = "I like 4k not 1080p or 720p videos"; var pattern = /\d+/g; var result = str.match(pattern); document.getElementById("point").innerHTML = result; } </script> </body> </html>
OUTPUT
×

Save as Private