flutter_subtitle_wrapper icon indicating copy to clipboard operation
flutter_subtitle_wrapper copied to clipboard

RegExp for Subtitle Text doesn't match more than two lines of subtitles

Open lrorpilla opened this issue 2 years ago • 1 comments

It seems that if I plug in the following regular expression for subtitles into a test site like regex101, ((\d{2}):(\d{2}):(\d{2})\,(\d+)) +--> +((\d{2}):(\d{2}):(\d{2})\,(\d{3})).*[\r\n]+\s*((?:(?!\r?\n\r?).)*(\r\n|\r|\n)(?:.*))

The 11th capture group which is used for text will not match more than two lines of text. This is a problem for some subtitles that deliberately newline their subtitles rather than throwing it all in a single line, and mismatches behavior from most video players.

Test String:

22
00:02:25,603 --> 00:02:29,524 
This is an example test string
I will match
I will not

lrorpilla avatar Jul 04 '21 04:07 lrorpilla