Regex to match filename at end of URL

后端 未结 6 2140
清歌不尽
清歌不尽 2020-12-29 21:55

Having this text:

http://img.oo.com.au/prod/CRWWBGFWG/1t44.jpg

And other texts like this where the

6条回答
  •  悲哀的现实
    2020-12-29 22:28

    As Johnsyweb says, a regular express isn't really needed here. AFAIK the fastest way to do this is with lastIndexOf and substr.

    str.substr(str.lastIndexOf('/'));
    

提交回复
热议问题