我的JSON数据:
[
"delivery_1b36940ef75c49a8864d8cb3ea6a3a9f",
"toPayBtn_10021",
"item_fdd0772d0dd74dea93033761ca14e781",
"item_4f1a3f6fd3afdb940be008a0d325f9ad",
"delivery_d69dc5e9df971c9b2b1736c2231cb4a9",
"orderTotal_1",
"address_BILLING#1",
"delivery_185e36d98d5e4cc1808e59e44df8c71c",
"voucherInput_1",
"address_DELIVERY#1",
"item_864e1a7daf2aa424cbcb2251d55abda9",
"item_913196f953cbe8cfc2851c8fa9498607"
]
我希望与toPayBtn_10021
匹配,但toPayBtn_
之后的数字是动态的,可以是toPayBtn_10
toPayBtn_2
toPayBtn_847
等...
我试过了
jq '.toPayBtn_*'
但它不起作用,我该如何解决?
答案 0 :(得分:1)
.[] | select( test("^toPayBtn_") )