Regular Expression to collect everything after the last /

前端 未结 8 1830
北荒
北荒 2020-11-28 05:16

I\'m new at regular expressions and wonder how to phrase one that collects everything after the last /.

I\'m extracting an ID used by Google\'s GData.

8条回答
  •  一整个雨季
    2020-11-28 05:55

    Not a PHP programmer, but strrpos seems a more promising place to start. Find the rightmost '/', and everything past that is what you are looking for. No regex used.

    Find position of last occurrence of a char in a string

提交回复
热议问题