我要让这样的文字:过滤词和数字文本文件
203
00:16:38,731 --> 00:16:41,325
Happy Christmas.
your arse I pray God it's our last.
是这样的变量:
Int section : 203
String start_time : 00:16:38,731
String end_time : 00:16:41,325
String Content :
Happy Christmas.
your arse I pray God it's our last.
在我的搜索,我发现使用正则表达式,但我不能使用它。这就是我发现它可以帮助理解我的意思:
Regex unit = new Regex(@"(?<sequence>\d+)\r\n(?<start>\d{2}\:\d{2}\:\d{2},\d{3}) --\> " + @"(?<end>\d{2}\:\d{2}\:\d{2},\d{3})\r\n(?<text>[\s\S]*?\r\n\r\n)", RegexOptions.Compiled | RegexOptions.ECMAScript);
这应该与字幕文件升 我怎么做工作?
谢谢:)
尝试'VAR解析度= unit.Replace(S,“内部部分:$ {序列} \ nString START_TIME:$ {开始} \ nString END_TIME :$ {end} \ nString Content:\ n $ {text}“);' –