开发者

Extract http urls from a string of multiple urls

开发者 https://www.devze.com 2023-01-13 06:37 出处:网络
I have a huge string of multiple URLs in javascript which is of the following format: var开发者_Python百科 urls = \"http://..... , http://..... , http://......\"

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

精彩评论

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