【问题标题】:Remove text between a semicolon and a quotation mark in Notepad++在 Notepad++ 中删除分号和引号之间的文本
【发布时间】:2020-05-19 13:48:12
【问题描述】:

我想删除第二个分号和行的最后一个引号之间的文本。 这是我目前得到的:

"number1;text1;text2;text3"

问题是我的文件中有很多行(超过一百行),就像我的文件中的前一行一样,而且文本总是不同的。例如,另一行可能是:

"number2;text4;text5;text6"

我想在替换栏中应用特定方法 (Ctrl + H) 来解决我的问题。

这就是我想要的:

"number1;text1" for the first line
"number2;text4" for the second line

【问题讨论】:

  • 结合正则表达式使用记事本的查找替换功能

标签: notepad++ notepad


【解决方案1】:
  • Ctrl+H
  • 查找内容:^[^;]+;[^;]+\K[^"]+
  • 替换为:LEAVE EMPTY
  • 检查 环绕
  • CHECK 正则表达式
  • 全部替换

说明:

^           # beginning of line
  [^;]+     # 1 or more non semicolon
  ;         # 1 semicolon
  [^;]+     # 1 or more non semicolon
  \K        # forget all we have seen until this position
  [^"]+     # 1 or more non double quote

屏幕截图(之前):

截图(之后):

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多