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

235
Vistas
Regex to match all the words that is not a interpolated string

I want to match all the words except interpolated string i.e, strings which are inside #{...}

'The variable 1 is #{vf a sr} abc' 'the variable 2 is #{var}' 'the variable is something' 'The variables are #{ b } and #{&c&}'

I want to avoid matching all the strings in {..} , as well as if there is any space character or special symbols inside it.

I have written one regex : /(?<![#{\w])\w+(?![\w}])/gi. It has one negative lookbehind (?<![#{\w]) and one negative lookahead (?![\w}). The problem is its still matching the a in {vf a sr}. And the regex also breaks if there is a special character like {&c&}, in this case it now match the c.

https://regex101.com/r/lEieyw/5

about 4 years ago · Juan Pablo Isaza
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