0
How to get the image name with regex?
https://bumbu.me/assets/images/2019/09/Extensions-Management-inspect-3-background-html.png How to get the name of the image (Extensions-Management-inspect-3-background-html.png) from the url using regex?
2 Answers
+ 3
Or this one đ
const link = "www.somesite.com/moretext/need-to-match-this.png";
console.log(link.match(/[^/]*$/)) //"need-to-match-this.png"
+ 1
Try this pattern:
"^.*/(.*$)"
(don't know how to implement it in JS though)
https://code.sololearn.com/c8wxN3e4gQsZ/?ref=app