Parse subtitle file using regex C#

前端 未结 5 475
南笙
南笙 2021-01-26 19:49

I need to find the number, the in and out timecode points and all lines of the text.

9
00:09:48,347 --> 00:09:52,818
- Let\'s see... what else she\'s got?
-          


        
5条回答
  •  深忆病人
    2021-01-26 20:08

    I am using following regular expression to parse .srt files:

    @"(?\d+)\r\n(?\S+)\s-->\s(?\S+)\r\n(?(.|[\r\n])+?)\r\n\r\n"
    

    Regular Expression Language - Quick Reference

提交回复
热议问题