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

165
Visualizações
Regex (Javascript) - How to replace certain character in a given string

I have the following case:

"SUM(A, SUM(A1, B, C), SUM(D, A3, F, M))"

Is there I way I could identify all the cells/columns which are the following letters:

Cells: A1, B1, C1, ... Columns: A, B, C, D, ...

COLUMNS are only A-Z

CELLS are [A-Z][1-*]

And replace only them & NOT replace any formula letter (i.e: SUM, AVERAGE, ...).

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If I'm understanding correctly, the goal is basically to avoid ending up replacing the formula letters.

Assuming you're able to use negative lookaheads, that could be done as simply as \b[A-Z]+[0-9]*\b(?!\(), since a formula will always be the letters followed by an open parenthesis.

Or, if you're positive there aren't more than 26 columns, then you could shorten it even more with \b[A-Z][0-9]*\b(?!\(). That is, removing the quantifier for the letter.

If there's some other constraint that would make this not work, then it would be helpful to have that information available in the question.

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