如何为后续post方法添加正则表达式提取器以获取摘要值。
<form method="post"
action="ModuleQuickMenu.aspx?mid=65&digest=nvBKUwJ18A66j4IJl7ppGA"
id="form1">
答案 0 :(得分:0)
请记住,您需要在正则表达式中转义BaggingClassifier
符号,以便它类似于:
const data = [{"user":1,"car":"volvo","score":7,"time":"some time"},{"user":2,"car":"volvo","score":8,"time":"some time"},{"user":3,"car":"volvo","score":9,"time":"some time"},{"user":3,"car":"opel","score":6,"time":"some time"},{"user":3,"car":"honda","score":8,"time":"some time"},{"user":4,"car":"volvo","score":6,"time":"some time"},{"user":4,"car":"opel","score":7,"time":"some time"},{"user":5,"car":"honda","score":8,"time":"some time"}];
let res = []
data.forEach((item) => {
if (res.length === 0) {
res.push({[[item.user]]: [item.score]})
}else {
let index = -1;
res.some((obj, i) => {
if (Number(Object.keys(obj)[0]) === item.user) {
index = i
return true;
}
return false;
})
if (index !== -1) {
res[index][item.user].push(item.score)
} else {
res.push({[item.user]: [item.score]})
}
}
})
console.log(res)
演示:
参考文献: