【发布时间】:2015-05-01 10:13:14
【问题描述】:
我正在尝试通过添加带有一些替代文本的新行来修改 Notepad++ 中 json 中的一些字符串。例如,文档某一部分的输入将是
"type": "apples_oranges_one",
"attribute": "bananas",
"type": "tomatoes_beans_celery",
"attribute": "bannanas",
然后我希望结果是
"type: "apples_oranges_one",
"type_alt": "strawberries_oranges_two",
"attribute": "bannanas",
"type": "tomatoes_beans_celery",
"attribute": "bannanas",
等等
我已经使用正则表达式通过使用查找/替换来查找来完成此操作
"type":"apples_oranges_one",
并用字符串替换它
"type": "apples_oranges_one", \n "type_alt": "strawberries_oranges_two",
有没有办法做到这一点,只需附加到“type”:“apples_oranges_one”,而不必替换整个字符串?我知道这似乎是一个很小的差异,但它会使我正在做的事情更有效率。
【问题讨论】:
-
请正确格式化。
标签: regex string append notepad++