Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Regular Expressions</h1> <p>Do a global search for the numbers 1 to 4 in a string:</p> <p id="demo"></p> <script> let text = "123456789"; let result = text.match(/[1-4]/g); document.getElementById("demo").innerHTML = result; </script> </body> </html>