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

150
Views
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 answers
Answer question

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 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!