Javascript正则表达式以匹配JSON键值对的值

bflemi3

给定以下键值对,我如何仅匹配值(包括引号)?

说明:我正在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*\")
德马蒂斯

您可以使用以下模式:

[:]\s(\".*\")

并通过以下链接对其进行测试:https : //regex101.com/r/nE5eV3/1

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章