Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

152
Vistas
Using Javascript RegExp to modifiy a link

I need your help and I'm a little bit lost. So I want to obtain "https://cloud.send.cm/i/00344/zofwynu8cxc7.jpg" from "https://send.cm/zofwynu8cxc7.html" . As you can see "zofwynu8cxc7" is the same in both links, so basically I need to copy this photo's id to the other link. This should be possibly using regexp in js, but I'm not quite sure how. Thank you

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Here's the new URL("") code:
not sure if path.slice() can be done with URL()

let url = new URL("https://send.cm/zofwynu8cxc7.html")
let path = url.pathname                                 // /zofwynu8cxc7.html
path = path.slice(0, path.length - 5)                   // /zofwynu8cxc7

console.log("https://cloud.send.cm/i/00344" + path + ".jpg")
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda