#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)(?=_{20,}|From:|On\s\w{3},\s\w{3}\s\d{1,2},\s\d{4}\sat\s\d{1,2}:\d{2})"
Local $sString = "Great thank you" & @CRLF & _
"________________________________" & @CRLF & _
"From: Blake <blake@foursocial.uk>" & @CRLF & _
"Sent: Saturday, August 31, 2024 9:46:12 AM" & @CRLF & _
"To: blake hoang <bjh2004@hotmail.co.uk>" & @CRLF & _
"Subject: Re: Ignition. Campaign" & @CRLF & _
"" & @CRLF & _
"Thanks , yes we can do it" & @CRLF & _
"---" & @CRLF & _
"Blake Junior" & @CRLF & _
"Managing Director | Foursocial." & @CRLF & _
"blake@foursocial.uk<mailto:blake@foursocial.uk>" & @CRLF & _
"Submission Links<https://linktr.ee/foursocial1>" & @CRLF & _
"[https://ci3.googleusercontent.com/mail-sig/AIorK4yeSFbHM5imdVzOjDTr7LwNvS9gqpyQ83uajylr7mDBuRn5ymG1jlev6Zz8vvgQMzDLAYjFLcR7LVLu]" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"On Sat, Aug 31, 2024 at 9:45 AM blake hoang <bjh2004@hotmail.co.uk<mailto:bjh2004@hotmail.co.uk>> wrote:" & @CRLF & _
"Hey there let me know the fee"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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