删除notepad ++ regex中两个模式之间的行

时间:2015-03-24 15:10:34

标签: notepad++

(?<=] = {)(.*\n?)(?=\},)

这就是我想出来的,我是这个正则表达式的新手。我想要做的是删除“] = {”之后和“}之前的文本/行,

问题是,我的很多行重复,每当我搜索'(?&lt; =] = {)(。* \ n?)(?=},)'它突出显示最顶层的“] = {”和最底部的“}”。我希望它突出显示'NEXT'“},”。对不起,如果我不能让自己更清楚。英语不是我的母语。 TY!

这是我需要编辑的文本文件的0.01%。

[502] = {
    unidentifiedDescriptionName = {
        "A potion made from grinded Red and Yellow Herbs that restores ^000088about 105 HP^000000.",
        "^ffffff_^000000",
        "Weight: ^77777710^000000"
    },
    identifiedDisplayName = "Orange Potion",
    identifiedResourceName = "주홍포션",
    identifiedDescriptionName = {
        "A potion made from grinded Red and Yellow Herbs that restores ^000088about 105 HP^000000.",
        "^ffffff_^000000",
        "Weight: ^77777710^000000"
    },
    slotCount = 0,
    ClassNum = 0
},
[503] = {
    unidentifiedDescriptionName = {
        "A potion made from grinded Yellow Herbs that restores about ^000088175 HP^000000.",
        "^ffffff_^000000",
        "Weight: ^77777713^000000"
    },
    identifiedDisplayName = "Yellow Potion",
    identifiedResourceName = "노란포션",
    identifiedDescriptionName = {
        "A potion made from grinded Yellow Herbs that restores about ^000088175 HP^000000.",
        "^ffffff_^000000",
        "Weight: ^77777713^000000"
    },
    slotCount = 0,
    ClassNum = 0
},

我需要在'identifydisplayname'之前删除[502] = {到}}中的行。

有什么想法?提前致谢!这是我的第一篇文章! :d

1 个答案:

答案 0 :(得分:0)

你非常接近:

找到:(?<=] = {)(.*?)(?=\},)
替换为:NOTHING

确保您已选中. matches newline