#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(\d+/\d+/\d+, \d+:\d+\d+) - (.+?): (.*)"
Local $sString = "20/01/18, 08:11 - Peter: Good morning " & @CRLF & _
"" & @CRLF & _
"How are you?" & @CRLF & _
"" & @CRLF & _
"Peter" & @CRLF & _
"20/01/18, 09:00 - Caroline: I am fine thanks." & @CRLF & _
"You?" & @CRLF & _
"" & @CRLF & _
"20/01/18, 09:01 - Peter: Good" & @CRLF & _
"" & @CRLF & _
"I had some problems few days ago." & @CRLF & _
"" & @CRLF & _
"Now I am happy" & @CRLF & _
"" & @CRLF & _
"Are you working?" & @CRLF & _
"" & @CRLF & _
"20/01/18, 09:02 - Caroline: No I have to go to the supermarket to buy vegetables" & @CRLF & _
"" & @CRLF & _
"20/01/18, 09:12 - Peter: Nice!" & @CRLF & _
"" & @CRLF & _
"Where are you now?"
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