regexlibreofficelibreoffice-writer

Regular expression in Libre Office Writer to remove timings of transcription


I'm using openai's Whisper to convert an audio to text.

I get an output indexed by time entries of the form [01:28.000 --> 01:36.000].

I'd like to remove these in Libre Office Writer using the Find and Replace tool.

However, what's the convention to write this pattern, i.e. [ followed by something, followed by arrow, followed by something, followed by ] in Libre Office?


Solution

  • There are multiple possible regular expression, this one is the most simple one:

    ^\[.+?\]

    If you insist of matching the arrow, it is:

    ^\[.+?-->.+?\]

    What does it mean?

    Leave the field for the replacement empty to remove the time stamp.

    If you need to remove the blank between the time stamp and the text, which I assume exists, add a blank at the end of the pattern.

    The documentation linked from Writer's help page is most helpful.