$.ajax({
url: link, //https://www.linkedin.com/company/666511/
type: 'GET',
success: function (data) {
console.log(data)
//response comes in 2000 lines
here is the sample short response
["Web Development","Professional Training","Apprenticeship","Nonprofit"]
,
"companyPageUrl":"http://www.thedifferenceengine.io"
//i only want this link to return
http://www.thedifferenceengine.io
}
});
i dont understant what regex or jquery require or how i remove this "e and get companypageurl
最佳答案
您可以使用正则表达式
/http:[^;]+/
let str = '["Web Development","Professional Training","Apprenticeship","Nonprofit"],"companyPageUrl":"http://www.thedifferenceengine.io"'
console.log(str.match(/http:[^;]+/));
关于javascript - 从 json 响应获取数据需要什么正则表达式或功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46584462/