如何删除一列中包含重复文本的行?

时间:2019-07-05 12:01:16

标签: notepad++

假设我们有类似这样的行,也包含其他内容

0000000470{201906037143845092  xyz....
0000000470{201906037143845092  abc,,,,
0000000470{201906037143845092  pqr////

假设我只想删除包含201906037143845092的整行 你能帮我吗?

我希望结果中除包含201906037143845092的行以外,还有其他行

1 个答案:

答案 0 :(得分:0)

  • Ctrl + H
  • 查找内容:^.*201906037143845092.*(?:\R|$)
  • 替换为:LEAVE EMPTY
  • 检查环绕
  • 检查正则表达式
  • 取消检查. matches newline
  • 全部替换

说明:

^                       # beginning of line
  .*                    # 0 or more any character butt newline
  201906037143845092    # the string to search
  .*                    # 0 or more any character butt newline
  (?:\R|$)              # any kind of linebreak OR end of line

给出:

0000000470{201906037143845092  xyz....
0000000470{201906037143845092  abc,,,,
0000000470{201906037143845092  pqr////
0000000470{201806037143845092  xyz....
0000000470{201706037143845092  abc,,,,
0000000470{201606037143845092  pqr////

给定示例的结果

0000000470{201806037143845092  xyz....
0000000470{201706037143845092  abc,,,,
0000000470{201606037143845092  pqr////

屏幕截图:

之前:

enter image description here

之后:

enter image description here