#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)Reg: Email:"
Local $sString = "Hi," & @CRLF & _
"Congrats, your offer on a Ford Ka for the price of £2,000.00, was the winning offer!" & @CRLF & _
" " & @CRLF & _
"Car Details" & @CRLF & _
" Ford Ka " & @CRLF & _
"Model: Ford Ka" & @CRLF & _
"Reg: LN61XVW" & @CRLF & _
"Fee: £229.0" & @CRLF & _
"Distance: 32 miles" & @CRLF & _
"Mileage: 28709" & @CRLF & _
"Car age: 13" & @CRLF & _
"Colour: BLACK" & @CRLF & _
"See customer details" & @CRLF & _
"" & @CRLF & _
"You’ll need to find a time that’s right for both parties so you can inspect the vehicle and make sure it looks as good as advertised." & @CRLF & _
"" & @CRLF & _
"Ask us to collect for you or pick it up yourself and arrange payment with the seller." & @CRLF & _
" " & @CRLF & _
"Customer Contact Details" & @CRLF & _
" " & @CRLF & _
"Name: Donna Irwin" & @CRLF & _
"Phone: +447884015643" & @CRLF & _
"Email: donna.irwin@btinternet.com" & @CRLF & _
"Postcode: AL1 2ET" & @CRLF & _
" " & @CRLF & _
"Follow the link below to get in touch and exchange details." & @CRLF & _
"Contact the seller here" & @CRLF & _
"Use the help link below if you have any questions." & @CRLF & _
" " & @CRLF & _
" " & @CRLF & _
"Happy Hunting," & @CRLF & _
"The Carwow Team"
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