1.json 提取
例1:數(shù)據(jù)格式:
"categoryCount":,
"studentList":[
{
"userId":,
"sessionUserTrackingId":,
"fullName":"",
"score":null,
"percentScore":null,
"statusId":1,
"scoreOrder":1,
"isLate":false,
"isEmend":false,
"emendQuestionCount":0,
"emendCount":0,
"intensifyEmendQuestionCount":0,
"intensifyEmendCount":0,
"emendStatus":"",
"emendTypeCode":"NO_NEED",
"completedOn":null,
"endDate":"",
"alreadyPay":false
},
{
"userId":,
"sessionUserTrackingId":,
"fullName":"",
"score":null,
"percentScore":null,
"statusId":1,
"scoreOrder":2,
"isLate":false,
"isEmend":false,
"emendQuestionCount":0,
"emendCount":0,
"intensifyEmendQuestionCount":0,
"intensifyEmendCount":0,
"emendStatus":"",
"emendTypeCode":"NO_NEED",
"completedOn":null,
"endDate":"1538150340",
"alreadyPay":false
},
提取userId對(duì)應(yīng)的sessionUserTrackingId的對(duì)應(yīng)提取方式: $..[?(@.userId==123)].sessionUserTrackingId。
2.如果我們想要拿到某一個(gè)字段的部分?jǐn)?shù)據(jù)的話可以使用:
contractId:"contract1234567"
如果我們提取1234567的話,使用正則表達(dá)式匹配:"contract:(.+?)"