LR用正则表达式获取
LR用正则表达式获取亲们,如何用正则表达式获取以下值?
这是服务器返回请求的部分,加粗部分需要正则表达式匹配关联
<input id="edit:foplList" type="hidden" name="edit:foplList"
value="[{"disabled":false,"label":"58 ","value":"001","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"同城","value":"1","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"1","value":"11","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"1","value":"111","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"YSJ平台","value":"123","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"大众点评网","value":"2016","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"折800","value":"901","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"京东平台","value":"JDPT","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"苏宁易购","value":"SNYG","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"淘宝平台","value":"TBPT","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"天猫平台","value":"TMPT","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"WORLD平台","value":"WDPT","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"一号店","value":"YHD","escape":false,"noSelectionOption":false},
{"disabled":false,"label":"亚马逊","value":"YMX","escape":false,"noSelectionOption":false}]" />
这是web_submit_data部分,加粗部分需要正则表达式匹配关联
/*"Name=edit:foplList", "Value=[{\"disabled\":false,\"label\":\"58\",\"value\":\"001\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"同城\",\"value\":\"1\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"1\",\"value\":\"11\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"1\",\"value\":\"111\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"YSJ平台\",\"value\":\"123\",\"escape\""
":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"大众点评网\",\"value\":\"2016\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"折800\",\"value\":\"901\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"京东平台\",\"value\":\"JDPT\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"苏宁易购\",\"value\":\"SNYG\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"""淘宝平台\",\"value\":\"TBPT\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"天猫平台\",\"value\":\"TMPT\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"WORLD平台\",\"value\":\"WDPT\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"一号店\",\"value\":\"YHD\",\"escape\":false,\"noSelectionOption\":false},{\"disabled\":false,\"label\":\"亚马逊\",\"value\":\"YMX\",\"escape\":false,\"noSelectionOption\":false}]", ENDITEM,*/
一般我用过的取数组里的是这样取的"value":\["(.+?),你可以自己在看着匹配一下 用左右边界取值,左边界,右边界都要正则表达式来写,问题是怎么写都匹配不出来 左边界是abel\":\",右边界是\",\"value。这样就可以把所有值存到一个数组里面。然后遍历数组,就可以取到所有值 谢谢,此问题已解决
页:
[1]