#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^\d+$\n"
Local $sString = "278" & @CRLF & _
"00:15:13,442 --> 00:15:14,436" & @CRLF & _
"Mr. Burns," & @CRLF & _
"" & @CRLF & _
"279" & @CRLF & _
"00:15:14,454 --> 00:15:17,893" & @CRLF & _
"I came here because my brother" & @CRLF & _
"is about to be wrongfully convicted," & @CRLF & _
"" & @CRLF & _
"280" & @CRLF & _
"00:15:17,947 --> 00:15:19,514" & @CRLF & _
"and the man I'm looking for" & @CRLF & _
"" & @CRLF & _
"281" & @CRLF & _
"00:15:19,542 --> 00:15:21,010" & @CRLF & _
"would help me find the truth." & @CRLF & _
"" & @CRLF & _
"282" & @CRLF & _
"00:15:21,038 --> 00:15:21,907" & @CRLF & _
"Don't you get it?" & @CRLF & _
"" & @CRLF & _
"283" & @CRLF & _
"00:15:21,932 --> 00:15:23,918" & @CRLF & _
"I don't care who you are" & @CRLF & _
"or what you want." & @CRLF & _
"" & @CRLF & _
"284" & @CRLF & _
"00:15:25,167 --> 00:15:26,801" & @CRLF & _
"Now get lost." & @CRLF & _
"" & @CRLF & _
"285" & @CRLF & _
"00:15:29,102 --> 00:15:31,170" & @CRLF & _
"I think you just sent away" & @CRLF & _
"the first person" & @CRLF & _
""
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm