Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
No se puede detectar el enlace del texto con múltiples enlaces en el texto React js

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!