Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda