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

214
Views
Esta expresión del regulador no funciona dentro de la función JS. ¿Alguien sabe el motivo?

Hice expresiones regulares y las apliqué dentro de esta función. Probé en el motor regex y funciona bien, pero no sé por qué no lo hace dentro de esta función JS

 function validURL(str) { var pattern = new RegExp( '^((https?)://)(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z]'+ '[A-Za-z0-9\-]*[A-Za-z0-9])(:[0-9]*)?'+ '(?:\/[\+~%\/\.\w\-]*)?\??(?:[\-\+=&;%@\/%\.\w]*)#?'+ '([\-\+=&;%@\/%\.\w]*)$',"i" ); var isValid = pattern.test(str); return isValid; }

Entrada: https://www.xml.com/pub/a/2003/09/17/stax.html#id=_abc

Resultado de salida: me da errores de sintaxis. ¿Alguien puede aconsejarme con una razón?

Gracias por adelantado

Saludos

about 4 years ago · Juan Pablo Isaza
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!