Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
Replace BB code with hyperlinks for ALL occurrences

I have this replace code to parse BB code and convert links to clickable hyperlinks. This works for one link, however if there is more than one link in the string, it merges them together in one long link, hyperlinking all text in between. I thought the [g] flag accounted for this, but doesn't appear to work.

about = about.replace(/\[url=([^\s\]]+)\s*\](.*(?=\[\/url\]))\[\/url\]/g, '<a href="$1" target="_blank">$2</a>')
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I worked it out with the following:

about = about.replace(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, "<a href=\"$1\" target=\"_blank\">$2</a>")

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda