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

221
Views
cómo extraer una matriz de una cadena en javascript

Tengo una cadena que contiene una matriz y un corchete, quiero extraer datos de ella.

 let vr = "- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API."

¿Cómo puedo identificar dinámicamente si una matriz está presente en esta cadena, como tomar [Next.js Documentation] ya que es una matriz? Por favor ayúdame en este problema.

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

0

Puede usar expresiones regulares con String.prototype.match() de javascript.

El patrón de expresión regular para que coincida con cualquier cosa encerrada entre corchetes es /\[(.*?)\]/gm . Puedes consultar aquí .

¡Buena suerte!

about 4 years ago · Juan Pablo Isaza Report

0

 let vr = "- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API." const regex = /\[([^\]]+)\]\(([^)]+)\)/g; let match; let result = []; while ((match = regex.exec(vr)) !== null) { result.push(match[1]); } console.log(result);

about 4 years ago · Juan Pablo Isaza Report

0

let vr = "- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API." const re = /\[([^]*?)]/g; let match = re.exec(vr); if (match !== null) { console.log(match[1]); } else { // not matched }
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!