#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?i)(\d+\$)(a*(\W))from(a*(\W))steam(?:\s*\n)*\s?\[(steamcommunity\.com\/gift\/[^\]]+)\]\((https?:\/\/[^\s]+\.[^\s]+)\)"
Local $sString = "50$ From steam" & @CRLF & _
"[steamcommunity.com/gift/8349393928202](https://scamlink.net/etc)" & @CRLF & _
"" & @CRLF & _
"200$ from steam" & @CRLF & _
"[steamcommunity.com/gift/8349393928202](http://another.link)" & @CRLF & _
"" & @CRLF & _
"Random message 50$ From steam" & @CRLF & _
"[steamcommunity.com/gift/8349393928202](https://scamlink.net/etc) @everyone"
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