我怎样才能让 notepad++ 删除每一行(包括“ ”内容)和每个奇数行上除了第二个“ ”的内容之外的所有内容?

我怎样才能让 notepad++ 删除每一行(包括“ ”内容)和每个奇数行上除了第二个“ ”的内容之外的所有内容?

例如:

line 1:"advancements.adventure.adventuring_time.description": "Tüm biyomları keşfet",

line 2: "advancements.adventure.adventuring_time.title": "Macera Zamanı",`

我希望它删除所有内容,但是Macera Zamanı

谢谢

答案1

  • Ctrl+H
  • 找什么:^.*\R(?:[^"]*"){3}([^"]*)".*
  • 用。。。来代替:$1
  • 查看 环绕
  • 查看 正则表达式
  • 取消选中 . matches newline
  • Replace all

解释:

^           # beginning of line
    .*          # 0 or more any character
    \R          # any kind of linebreak (i.e. \r, \n, \r\n)
    (?:         # non capture  group
        [^"]*       # 0 or more any character that is not double quote
        "           # double quote
    ){3}        # end group, must appear 3 times
    ([^"]*)     # group 1, 0 or more any character that is not double quote
    "           # double quote
    .*          # 0 or more any character

替代品:

$1          # content of group 1, the data between the second pair of quotes

截图(之前):

在此处输入图片描述

截图(之后):

在此处输入图片描述

相关内容