<!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>