- 论坛徽章:
- 0
|
本帖最后由 david_95 于 2015-07-01 18:08 编辑
有文本文件内容如下:
item_package_dimensions: [
{
length: {
normalized_value: {
unit: inches,
value: 10.599999989188,
},
unit: centimeters,
value: 26.924,
},
width: {
normalized_value: {
unit: inches,
value: 10.49999998929,
},
unit: centimeters,
value: 26.67,
},
height: {
normalized_value: {
unit: inches,
value: 1.699999998266,
},
unit: centimeters,
value: 4.318,
},
source_customer_id: 120098015,
},
],
manufacturer: [
{
value: "Hasbro Games",
language_tag: zh_CN,
},
],
。。。 下面还有很多类似字符串
我想搜索匹配item的相应内容 ,比如我搜“width”,从“:{”开始 ,读取其下所有的字符串,直到遇到对应的“}”为止
问题:
1 我可以用正则匹配找到第一个 width, 我怎么定位到该行,并从该行开始继续读入
2 我怎么找到对应的结束符 }
脑子转不动了,求指点 |
|