JSFiddle - React, Tailwind, and code Playground

JavaScript

var r = new RegExp("\\&#\\d\\d\\;", "g"); 
//var r = new RegExp(/(\&\#\d\d\;){1,}/g); //  ...

var s = "' ^ hola tio, que tal estas? !";
var e = r.exec(s);

if(e !== null && e.length >= 1) { 
    var f = e[0];
   
    s = s.replace(f, "");

    f = f.replace("&", "").replace("#", "").replace(";", "");
    f = String.fromCharCode(f);
    f = f.concat(s);
    alert(f);
}