#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mx)^" & @CRLF & _
"(?P<interesting>.+?) # before" & @CRLF & _
"(?P<uid>\b\w{8}-(?:\w{4}-){3}\w{12}\b) # uid" & @CRLF & _
"(?P<junk>.+) # garbage" & @CRLF & _
"$"
Local $sString = "00000 Gin-a19ea68e-64bf-4471-b4d1-44f6bd9c1708-62fa6ae2-599c-4ff1-8249-bf6411ce3be7-83930e63-2149-40f0-b6ff-0838596a9b89 Kin" & @CRLF & _
"00000 Gin-a19ea68e-64bf-4471-b4d1-44f6bd9c1708 Kin" & @CRLF & _
"test123 test 12345678-1234-1234-1234-123456789012 junk afterwards" & @CRLF & _
""
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