JSFiddle - React, Tailwind, and code Playground

JavaScript

var str="+9(999)9999999";
alert(str.replace(/[()]/g,''));