Intenté obtener el enlace del texto usando el siguiente código
urlify(description) { const regex = /(.+)\[(.+)\]\((.+)\)/; return description.replace(regex, (match, a, b, c) => { const text = `${a[0].toUpperCase()}${a.substring(1)}${b}`; return a+' '+`<a href="${c}" target="_blank">${b}</a>`; }); } render() { let description='Hello this is [XYZ](wwww.XYZ.com) and please redirect to [PQR] (www.PQR.com)' return ( <p dangerouslySetInnerHTML={{__html: this.urlify(description),}}></p> ); } }La salida que obtengo aquí es como
Hola, soy XYZ y redirija a PQR. Solo el último enlace se obtiene como se requiere. Estoy intentando algo como "Hola, soy XYZ y redirija a PQR", donde XYZ y PQR solo deben actuar como enlace y (wwww.XYZ.com ), ( www.PQR.com ) dicho enlace debe actuar únicamente como href.