Notepad++ 在记事本++;

Notepad++ 在记事本++;,notepad++,Notepad++,如何擦洗下面文本的最后一部分以仅检索到.xls之前的数据 /Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls, 247 KB, 06/11/2013 我只需要这一部分,/Artifacts&Supporting Docs/AR.01-WLCE队列模式Rel 3.0最终版,2013年1月3日。xls 我尝试使用下面的命令,但没有按预期工作 选定的正则表达式和换行符。已

如何擦洗下面文本的最后一部分以仅检索到.xls之前的数据

/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls, 247 KB, 06/11/2013
我只需要这一部分,
/Artifacts&Supporting Docs/AR.01-WLCE队列模式Rel 3.0最终版,2013年1月3日。xls

我尝试使用下面的命令,但没有按预期工作

选定的正则表达式和换行符。已检查匹配案例

查找内容:,[0-9]*

替换为:(留空)


尝试查找正则表达式
xls,.*$
,并将其替换为
xls
。您的正则表达式将匹配任何后跟数字字符的coma,它太宽。

尝试查找正则表达式
xls,.*$
,并将其替换为
xls
。您的正则表达式将匹配任何后跟数字字符的coma,它太宽了。

  • Ctrl+H
  • 查找内容:
    \.\S+\K,.+$
  • 替换为:
    留空
  • 检查环绕
  • 检查正则表达式
  • 取消选中
    。匹配换行符
  • 全部替换
说明:

\.      # a dot
\S+     # 1 or more non spaces
\K      # forget all we've seen until this position
,       # a comma
.+      # 1 or more any character but newline
$       # end of line
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv
给定:

\.      # a dot
\S+     # 1 or more non spaces
\K      # forget all we've seen until this position
,       # a comma
.+      # 1 or more any character but newline
$       # end of line
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv
给定示例的结果:

\.      # a dot
\S+     # 1 or more non spaces
\K      # forget all we've seen until this position
,       # a comma
.+      # 1 or more any character but newline
$       # end of line
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv
屏幕截图:

\.      # a dot
\S+     # 1 or more non spaces
\K      # forget all we've seen until this position
,       # a comma
.+      # 1 or more any character but newline
$       # end of line
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv

  • Ctrl+H
  • 查找内容:
    \.\S+\K,.+$
  • 替换为:
    留空
  • 检查环绕
  • 检查正则表达式
  • 取消选中
    。匹配换行符
  • 全部替换
说明:

\.      # a dot
\S+     # 1 or more non spaces
\K      # forget all we've seen until this position
,       # a comma
.+      # 1 or more any character but newline
$       # end of line
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv
给定:

\.      # a dot
\S+     # 1 or more non spaces
\K      # forget all we've seen until this position
,       # a comma
.+      # 1 or more any character but newline
$       # end of line
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv
给定示例的结果:

\.      # a dot
\S+     # 1 or more non spaces
\K      # forget all we've seen until this position
,       # a comma
.+      # 1 or more any character but newline
$       # end of line
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv
屏幕截图:

\.      # a dot
\S+     # 1 or more non spaces
\K      # forget all we've seen until this position
,       # a comma
.+      # 1 or more any character but newline
$       # end of line
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv, 247 KB, 06/11/2013
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.xls
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.pdf
/Artifacts & Supporting Docs/AR.01 - WLCE cohort schema Rel 3.0 final Jan, 3, 2013.csv

我正在寻找一个更通用的表达式,它将匹配.pdf、.xlsx、.csv等。我的regex适用于大多数情况,但如上所述的特殊情况下,这是失败的。在本例中,regex
,[0-9].*
应在1月后匹配所有内容。您能发布更多文件行,以便我们可以尝试找到通用表达式吗?我正在寻找一个更通用的表达式,该表达式将匹配.pdf、.xlsx、.csv等。我的Reg ex适用于大多数情况,但特殊情况如上所述,这是失败的。在本例中,regex
,[0-9].
应该在1月之后匹配所有内容。您能否发布更多的文件行,以便我们可以尝试找到通用表达式?