Replace 记事本++;替换函数
可以以某种方式自动替换为以下结果: 首字母:Replace 记事本++;替换函数,replace,notepad++,notepad,Replace,Notepad++,Notepad,可以以某种方式自动替换为以下结果: 首字母: "eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}} "[^"]+" : 1 or more not quote beweeen quotes ,"doc" : literally {"emojiAnnotations":{ : literally $0 : the
"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}
"[^"]+" : 1 or more not quote beweeen quotes
,"doc" : literally
{"emojiAnnotations":{ : literally
$0 : the whole match
{"emojiAnnotations":{"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}
结果:
{"emojiAnnotations":{"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}
当“眼睛”等是变量时……(只有标题是相同的)
我想用-“*”、“doc”之类的东西替换(作为一个表达式)为{“emojiAnnotations”:“*”、“doc”,但这不会保留变量“eye”等等
p.S.这是更换过程的一部分,因此在开始时添加是不可接受的这对您合适吗
- Ctrl+H
- 查找内容:
“[^”]+”,“doc”
- 替换为:
{“emojiAnnotations”:{$0
- 检查环绕
- 检查正则表达式
- 全部替换
"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}
"[^"]+" : 1 or more not quote beweeen quotes
,"doc" : literally
{"emojiAnnotations":{ : literally
$0 : the whole match
{"emojiAnnotations":{"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}
更换:
"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}
"[^"]+" : 1 or more not quote beweeen quotes
,"doc" : literally
{"emojiAnnotations":{ : literally
$0 : the whole match
{"emojiAnnotations":{"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}
给定示例的结果:
"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}
"[^"]+" : 1 or more not quote beweeen quotes
,"doc" : literally
{"emojiAnnotations":{ : literally
$0 : the whole match
{"emojiAnnotations":{"eye","doc":441,"engagement":35877,"impression":1987869,"reach":294757,"repost":441}}
请,并添加更多的上下文。前后多行以及预期的结果。@Toto where eye and numbers-此区域将更改,只需想象顶部和底部随机不同的信息。这是一个大的JSON文件。但我需要在这一部分中找出答案(如果这不可能…那么sad()你知道怎么用python来做吗?@NANA:这很相似。试试这个:
res=re.sub(r'(“[^”]+”,“doc”),“{”emojiAnnotations:{\g',str)
你必须在导入re之前导入re。