JSFiddle - React, Tailwind, and code Playground
JavaScript
var stringExemplo = "texto 1 <b> texto 2 </b> texto 3 <b> texto 4 </b>";
stringExemplo = stringExemplo.replace(/<b>/g , "<i>");
var resultado = stringExemplo.replace(/<\/b>/g, "</i>");
console.log(resultado);