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?
-
I think there's two problems with the regex. The first is that the .
near the end in (?.+)
is not matching newlines. So you could modify it to:
(?(.|[\r\n])+?)
Or you could specify RegexOptions.Singleline
as an option to the regex. The only thing the option does is make the dot match newlines.
The second problem is that .+
matches as many lines as it can. You can make it non-greedy like:
(?(.|[\r\n])+?(?=\r\n\r\n|$))
This matches the least amount of text that ends with an empty line or the end of the string.