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

101
Views
Cypress Intercept, URL de refinación

Estoy interceptando una solicitud con Cypress y estoy tratando de no codificar algo. Para que funcione correctamente, tengo que agregar un "1" ya que estoy tratando de interceptar algo como esto:

/api/v1/contacts/cfs:12345/forms/144543

El problema es que hay otras solicitudes como /forms/something que se interceptan si uso formularios/**, lo que lleva a esto:

let urlResponse = '/api/v1/contacts/cfs:' + $code + '/forms/1**'

¿Hay alguna expresión regular o algo que me permita interceptar la URL que es forms/number y no forms/something o forms/number/something ?

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

0

Aquí hay algunas expresiones regulares para hacer coincidir solo el patrón .../forms/number.

 const inputs = [ '/api/v1/contacts/cfs:12345/forms/144543', '/api/v1/contacts/cfs:12345/forms/something', '/api/v1/contacts/cfs:12345/forms/144543/something' ]; const regex = new RegExp('/api/v1/contacts/cfs:12345/forms/[0-9]+$'); for (let input of inputs) { const isMatch = regex.test(input); console.log(isMatch); }

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!