【问题标题】:EditPad Regex replacement of transcription timestampsEditPad 正则表达式替换转录时间戳
【发布时间】:2018-03-14 14:29:45
【问题描述】:

我正在尝试从 Youtube 视频中提取转录文本并将其解析为文档以进行编辑。 我已经能够删除放置在其中的大部分 HTML 标记。但是,我想删除下面的代码,这是已经被解析成单个字符串的时间戳和偏移量。

我试过这个,但我不擅长正则表达式:

/^\d{2}\:\d{8}\"\>$/gm

在 Regex101 测试器 (https://regex101.com/r/a9wi2j/3/) 中,它可以工作,但在 EditPad 替换中,它不能。

EditPad 中的什么正则表达式会删除所有以 "> 以下结尾的行?

03:17197850">
that so if you have production staff you
03:21201780">
can create logins like that for them and
03:24204299">
then they have access to all the
03:25205739">
information and everything they need but
03:27207359">
they can't go in and adjust pricing on
03:30210060">

【问题讨论】:

  • 去掉>后面的反斜杠:(?m)^\d{2}\:\d{8}\">$
  • 还是不行
  • 原来的没发,新发的发了,请贴出来作为答案。
  • 也许不是你想要的,但在 vim 中你可以做到:g/">$/d
  • vim 正则表达式在 Editpad 中不起作用

标签: regex editpad


【解决方案1】:

您需要在 > 之前删除反斜杠,因为在早期版本的 EditPad 中,\> 已被解释为单词边界,而最近的版本不支持此标记。

您也需要像在提供的演示中那样启用m 标志:

(?m)^\d{2}\:\d{8}\">$

【讨论】:

  • (?m)^\d*\:\d*\">$ 实际上效果更好,因为秒 + 偏移量可能超过 8 位。我知道分钟始终是 2 位数,但如果分钟超过 99,使用 * 会有所帮助。我不知道时间和偏移如何查看大于 60 分钟的视频。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-11-12
  • 2014-12-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多