#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)(?<=\n)(?<match>.+?(?<phone>\d[\d\s]{7,}).+Reference.+id[\w\W]+#(?<ref>\w+\b))"
Local $sString = "logo" & @CRLF & _
"[https://app.discountdata.ng/assets/images/full-logo.png]https://app.discountdata.ng" & @CRLF & _
"" & @CRLF & _
"Discount Data - Nigeria's topmost enterprise solution to your telecom needs." & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"NOTIFICATION ALERT" & @CRLF & _
"" & @CRLF & _
"Hi staffdd," & @CRLF & _
"" & @CRLF & _
"Glo CORPORATE GIFTING 1GB - 30 Days to 08110768733 Reference ID Is :" & @CRLF & _
"#202406131022Y5WSUG49ERTYGT666aba5d7dbd3" & @CRLF & _
"" & @CRLF & _
"If you wish to option out from this kind of mail, please contact us or ignore" & @CRLF & _
"this message." & @CRLF & _
"" & @CRLF & _
"If you face any issues, please contact us at help@discountdata.ng" & @CRLF & _
"" & @CRLF & _
"(c) 2024 Discount Data. All rights reserved." & @CRLF & _
"" & @CRLF & _
"This email was sent to you as a registered member of Discount Data" & @CRLF & _
"[https://app.discountdata.ng]. Thank You."
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