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

92
Vistas
regex string @[name of some thing](stringId)

I have a text with string content and a tag. I want to split the text into an array. I tried many ways but got some bugs @@

Input:

"This is a text with a @[name of tag](tagId). This is another @[name of another tag](tagId)"

Output:

array = ["This is a text with a ", "@[name of tag](tagId)", ". This is another " , "@[name of another tag](tagId)"]

The tag always has @[ at begin, ) at the end and ]( at between,

I tried

const str = "This is a text with a @[name of tag](tagId). This is another @[name of another tag](tagId)"
const result = str.split(/[@[)]/);
console.log(result);

But that has many issues like "", " " or missing @[ in result

Thanks for all help

about 4 years ago · Santiago Gelvez
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