开发者

Extract http urls from a string of multiple urls

I have a huge string of multiple URLs in javascript which is of the following format:

var开发者_Python百科 urls = "http://..... , http://..... , http://......"

I need to extract all URLs from the string into individual variables of part of an array. I cant do a urls.split(",") as some urls seem to have commas in them.Is there a good regex I can use to solve this problem ?


Split on a larger string: ", http://" — that avoids the problem of commas in the middle of URLs.


Do you know for a fact that the URLs are separated by " , "? If so, split on that!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜