連接中獲取文件名

 

'算得上是-test.pdf' 獲取文件名

 

var str = 'http://aaa.com/s/ddd/算得上是-test.pdf';

console.log(str.match(/([^/*.]+)\.\w+$/))

console.log(str.match(/([^/*.]+)\.\w+$/)[0]) //
相關文章
相關標籤/搜索