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

120
Views
Get values inside quotes in javascript

Get values inside quotes in javascript, like in discord dyno bot uses ?poll "<title>" "<choice>" "<choice>", How do split the array so that I get the values of the title and choices in javascript

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

0

1) You can easily achieve the result using regex

/(?<=")[^"]+/

const str = `?poll "<title>" "<choice>" "<choice>"`;
const result = str.match(/(?<=")[^"]+/g).filter((s) => s.trim());
console.log(result);

2) If lookbehind is not supported then you can do as:

/"[^"]+/

const str = `?poll "<title>" "<choice>" "<choice>"`;
const result = str
  .match(/"[^"]+/g)
  .map((s) => s.slice(1))
  .filter((s) => s.trim());
console.log(result);

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!