JSFiddle - React, Tailwind, and code Playground

by m4xout

HTML

<p>Search for an "e" in the next paragraph:</p>

<p id="p01">The best things in life are free! [email protected]</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

JavaScript

function myFunction() {
    text = document.getElementById("p01").innerHTML; 
    document.getElementById("demo").innerHTML = /[^\s]*edu.au/g.test(text);
    
}