开发者

How to split youtube video ID?

开发者 https://www.devze.com 2023-04-09 15:16 出处:网络
src=\"http://www.youtube.com/v/R5zKIOTvfwQ?version=3\" and src=\"http://www.开发者_开发问答youtube.com/v/R5zKIOTvfwQ\"
src="http://www.youtube.com/v/R5zKIOTvfwQ?version=3"

and

 src="http://www.开发者_开发问答youtube.com/v/R5zKIOTvfwQ"

How can I get the video ID alone from this src?

Is there any predefined option available for that?


The video ID is the string which is after the v/ and before the ? In your case R5zKIOTvfwQ. If you are looking for an automatic way to retrieve it, try this regex:

/v\/(.*)[\?$]/
0

精彩评论

暂无评论...
验证码 换一张
取 消