我是一名助手,为您翻译以下内容:
应该长这样:
我已经搜索过,并没有发现类似的结果。
我想要做的是创建一个简单的PHP/js/jq脚本,可以对.srt文件进行添加或减去秒数。我不确定是否应该使用正则表达式来实现它或者其他什么方法。
用户将上传/复制SRT文件的文本,然后在输入框中添加他们想要从SRT中添加或减去的秒数。
例如,如果用户将+4秒添加到以下srt文件中:
0
00:00:04,594 --> 00:00:10,594
this is a subtitle
1
00:00:40,640 --> 00:00:46,942
this is another subtitle
2
00:02:05,592 --> 00:02:08,694
this is one more subtitle
应该长这样:
0
00:00:08,594 --> 00:00:14,594
this is a subtitle
1
00:00:44,640 --> 00:00:50,942
this is another subtitle
2
00:02:09,592 --> 00:02:12,694
this is one more subtitle