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

319
Views
JavaScript: How to extract multiple values from a sentence using regex?

I'd like to extract multiple values from the below sentance

var memo = 'BRD-35/21/9: DSI-35/21/641 - 154.0, DSI-35/21/617 - 84.0, TI-23/21223/12 - 78.98';

console.log(memo.match(/DSI\w*/g));

I'd like to get result as ['DSI-35/21/641', 'DSI-35/21/617', 'TI-23/21223/12']

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Maybe something like this:

    var memo = 'BRD-35/21/9: DSI-35/21/641 - 154.0, DSI-35/21/617 - 84.0, TI-23/21223/12 - 78.98';
    console.log([...memo.matchAll(/[,|:]\s([A-Z0-9\/-]*)/g)].map(function(el){return el[1];}));

about 4 years ago · Juan Pablo Isaza Report

0

The following regex should do what you want:

(DSI|TI)-\d+\/\d+\/\d+

Match DSI or TI followed by a -, then 3 digits separated by /.

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!