Notepad++ 替换功能

Notepad++ Replace function

可以以某种方式自动替换为这个结果:

初始值:

"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}

结果:

{"emojiAnnotations":{"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}

当"eye"等都是变量....(只有标题相同)??

我想使用 - "*","doc" 之类的东西将(作为表达式)替换为 {"emojiAnnotations":"*","doc",但这不会保持变量 "eye" 等等。

P.S. 这是替换过程的一部分,所以不能在开头添加

这适合你吗?

  • Ctrl+H
  • 查找内容:"[^"]+","doc"
  • 替换为:{"emojiAnnotations":{[=14=]
  • 选中环绕
  • 检查正则表达式
  • 全部替换

解释:

"[^"]+"     : 1 or more not quote beweeen quotes
,"doc"      : literally

替换:

{"emojiAnnotations":{   : literally
[=11=]                      : the whole match

给定示例的结果:

{"emojiAnnotations":{"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}