正则表达式从字幕文件中删除空行和时间戳

cod*_*eek 0 regex

我有一个下载的字幕文件,如下所示。该文件包含行号,空行和时间戳。我想删除这些行号,空行和时间戳,我只需要文本

现在是什么

1
00:00:01.876 --> 00:00:02.709
<v Instructor>We can go back now</v>

2
00:00:02.709 --> 00:00:05.042
to our web server checklist.

3
00:00:06.410 --> 00:00:08.722
We've already seen better ways to organise our code

4
00:00:08.722 --> 00:00:11.545
into reusable pieces with modules,

5
00:00:11.545 --> 00:00:13.315
we've seen ways to deal with files,

6
00:00:13.315 --> 00:00:15.940
both synchronous and asynchronous,

7
00:00:15.940 --> 00:00:16.773
and buffers,

8
00:00:16.773 --> 00:00:18.325
both the built-in Node one

9
00:00:18.325 --> 00:00:20.380
and the ES6 buffers,

10
00:00:20.380 --> 00:00:22.485
and we've seen a way to deal with work
Run Code Online (Sandbox Code Playgroud)

输出应该是什么

我们现在可以回到Web服务器清单。我们已经找到了更好的方法来将代码组织为具有模块的可重用部分,我们已经看到了处理文件的方法(同步和异步)以及缓冲区(内置的Node)一个和ES6缓冲区,我们已经看到了一种处理工作的方法

伙计们请帮我解决这个问题,我正在使用这个在线工具来实现

Yas*_*jaj 5

您要执行以下操作:

  1. 选择以数字或换行符开头的行。
  2. 选择行中的所有内容,直到最后
  3. 同时在行尾选择换行符

以下正则表达式完全做到了这一点

^[\d\n].*\n
Run Code Online (Sandbox Code Playgroud)

演示版

小小的免责声明:这将排除以数字开头的文本行


输出量

<v Instructor>We can go back now</v>
to our web server checklist.
We've already seen better ways to organise our code
into reusable pieces with modules,
we've seen ways to deal with files,
both synchronous and asynchronous,
and buffers,
both the built-in Node one
and the ES6 buffers,
and we've seen a way to deal with work
Run Code Online (Sandbox Code Playgroud)