#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?=^\d{1,2}\/\d{1,2}\/\d{4})"
Local $sString = "18/07/2018, 18:04 - Person2: message" & @CRLF & _
"18/07/2018, 18:04 - Person1: Yes" & @CRLF & _
"18/07/2018, 18:04 - Person2: That's good then" & @CRLF & _
"18/07/2018, 18:05 - Person1: message line 1" & @CRLF & _
" message line 2" & @CRLF & _
"18/07/2018, 18:05 - Person2: text" & @CRLF & _
"18/07/2018, 18:05 - Person2: But nvm" & @CRLF & _
"18/07/2018, 18:06 - Person1: text"
Local $sSubst = "-------------\n"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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