鉴于以下键值对,我如何只匹配值(包括引号)?
解释:我在IDE中进行查找和替换。我有数百个键/值对,其中值需要从字符串更改为对象。所以基本上取代了价值。
"ElevationFilenameIn": "Input raster elevation file",
"TargetCRS": "Target vertical coordinate reference system Type",
"featureName": "The name of the feature to extract, for example \"Vegetation\" or \"Water\"",
"TargetCRScode": "Target vertical coordinate system Code",
"TargetCRSfile": "The projection (.prj) file in shoebox to be used for this inputfile"
My attempt(这不起作用,甚至没有关闭):
[:]\s*(\"\w*\")
答案 0 :(得分:6)
答案 1 :(得分:3)
答案 2 :(得分:2)
答案 3 :(得分:0)
复杂 JSON 对象中的所有键值参数。
"[a-zA-Z0-9 -]*"(?=:):[a-zA-Z0-9 "-ć]*(?<=")|"[a-zA-Z0-9 -]*"(?=:):[a-zA-Z0-9 "-ć]*(?=,)|"[a-zA-Z0-9 -]*"(?=:):[a-zA-Z0-9 "-ć]*(?=\w+)