给定以下键值对,我如何才能只匹配值(包括引号)?
解释:我正在我的 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"
我的尝试(不起作用,甚至没有关闭):
[:]\s*(\"\w*\")
原文由 bflemi3 发布,翻译遵循 CC BY-SA 4.0 许可协议
您可以使用以下模式:
并通过此链接对其进行测试: https ://regex101.com/r/nE5eV3/1