我有多行这样的:
{
"source": "Source A",
"target": "Source B",
"idTarget": "3,345",
"strength": "0.5",
"value": "633.5138"
}
{
"source": "Source C",
"target": "Source D",
"idTarget": "1,253",
"strength": "0.7",
"value": "5465.238"
}
我想删除.
包含单词的行中的(点)value
,但不要删除其他行。所以看起来像这样:
{
"source": "Source A",
"target": "Source B",
"idTarget": "3,345",
"strength": "0.5",
"value": "6335138"
}
{
"source": "Source C",
"target": "Source D",
"idTarget": "1,253",
"strength": "0.7",
"value": "5465238"
}
有什么办法吗?
^"value":[^.]+\K\.
LEAVE EMPTY
. matches newline
解释:
^ : begining of line
"value": : literally
[^.]+ : 1 or more not dot
\K : forget all we have seen until this position
. : a dot
给定示例的结果:
{
"source": "Source A",
"target": "Source B",
"idTarget": "3,345",
"strength": "0.5",
"value": "6335138"
}
{
"source": "Source C",
"target": "Source D",
"idTarget": "1,253",
"strength": "0.7",
"value": "5465238"
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句