<html>
<body>
<h2>JavaScript RegExp</h2>
<p>The exec() method tests for a match in a string:</p>
<p>Search a string for the character "e":</p>
<p id="demo"></p>
<script>
let text = "The best things in life are free";
let result = /e/.exec(text);
document.getElementById("demo").innerHTML = result;
</script>
</body>
</html>