I once again need to mention how much I love regular expressions. Just wrote one that takes a VTT file and gives the first and last timestamps of groups of consecutive segments with the same speaker (e.g., Alice spoke from 02:31 to 17:03, then Bob spoke from 18:24 to 26:59).

#Regex

In case you want this regex:

`^([\d.:]+).+\n(<v .+>)(.+\n\n.+> ([\d.:]+)\n\2)+`
to
`\2\t\1\t\4`

It uses something I very seldom exploit: the fact that a back reference to a sub-pattern within a quantified pattern returns the last value that the sub-pattern matched (at least in BBEdit).

I could have explicitly written in a final instance outside of the quantified pattern, but this does feel more "elegant" ¯\_(ツ)_/¯