<html>
<body>
<h2>JavaScript Строковый поиск</h2>
<p>Искать в строке "ain":</p>
<p id="demo"></p>
<script>
let text = "The rain in SPAIN stays mainly in the plain";
document.getElementById("demo").innerHTML = text.match(/ain/g);
</script>
</body>
</html>