I have the following URL:
("file:///home/pasta/pasta/img/intro-bg.jpg")
I'd like to know what regular expression I can use to catch only intro-bg.jpg
If anyone can help me, thank you.
I have the following URL:
("file:///home/pasta/pasta/img/intro-bg.jpg")
I'd like to know what regular expression I can use to catch only intro-bg.jpg
If anyone can help me, thank you.
Another way:
const str = "file:///home/pasta/pasta/img/intro-bg.jpg";
const basename = str.replace(/^.*\//g, '');
console.log(basename);