Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!