JSFiddle - React, Tailwind, and code Playground
HTML
<div id="bar">
<input id="foo" type="button" value="blah"/>
</div>
JavaScript
bar.addEventListener('click', (event) => {
const myString = 'hhello world';
const regex = /[h]{2,}ello/;
console.log(regex.test(myString));
}, false);