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

98
Vistas
Regex to enclose objects in an array

I have lots of files containing many calls to a specific method which used to accept objects but now requires an array. I would like to use Notepad++ to find/replace all of these calls with the required array.

Here's an example:

attach({ name: 'filename', url: 'fileURL' })

This needs to be converted to:

attach([{ name: 'filename', url: 'fileURL' }])

Any help with this would be much appreciated.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I'd search for:

attach\((.+)\)

and replace it with

attach([$1])

This will capture everything between attach's parentheses and adds a pair of square brackets around it.

edit: Older versions of notepad++ use \1 instead of $1 to refer to the 1st captured group.

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