JSFiddle - React, Tailwind, and code Playground
HTML
<div dir="rtl" id="text">
مرحبا) في الهند 1234455)
</div>
JavaScript
function myText(){
var inputString = document.getElementById("text").value;
var result = inputString.match(/\(+/g);
alert(result);
}
myText();