gpt4 book ai didi

javascript - 从 json 响应获取数据需要什么正则表达式或功能

转载 作者:行者123 更新时间:2023-12-01 02:58:36 25 4
gpt4 key购买 nike

$.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 &quote 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com