如何从长日期中删除时间

如何从长日期中删除时间
0.00016794,0.06717899,11/25/2017 3:27:04 PM,11/26/2017 1:16:51 AM
0.00016636,0.06656090,11/30/2017 11:34:16 PM,11/30/2017 11:35:15 PM

我曾尝试使用这个\/2017.*?,但它只会删除每行第一次。

请协助。

答案1

  • Ctrl+H
  • 找什么:(?<=2017).+?M
  • 用。。。来代替:LEAVE EMPTY
  • 检查环绕
  • 检查正则表达式
  • 请勿检查. matches newline
  • Replace all

解释:

(?<=2017)   : lookbehind, zero-length assertion, make sure we have 2017 before current position
.+?         : 1 or more any character, not greedy
M           : literally "M"

给定示例的结果:

0.00016794,0.06717899,11/25/2017,11/26/2017 
0.00016636,0.06656090,11/30/2017,11/30/2017

相关内容